Skip to content

Commit

Permalink
Add maintenance page
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Aug 12, 2024
1 parent 1c13763 commit c3b840f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
file: docker/Dockerfile
push: true
build-args: |
GH_NEXT_PUBLIC_IS_MAINTENANCE=true
GH_NEXTAUTH_URL=https://epicapp.net
GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=https://epic-data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=wss://epic-data-hub.subsocial.network/graphql-ws
Expand Down Expand Up @@ -95,6 +96,7 @@ jobs:
file: docker/Dockerfile
push: true
build-args: |
GH_NEXT_PUBLIC_IS_MAINTENANCE=true
GH_NEXT_PUBLIC_AMP_ID=2ecd0305eaa641e48ef9a0fd6ab8a923
GH_NEXT_PUBLIC_GA_ID=fake
GH_IPFS_WRITE_URL=https://gw-seattle.crustcloud.io
Expand Down
1 change: 1 addition & 0 deletions ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NEXT_PUBLIC_CONTEST_END_TIME='$GH_NEXT_PUBLIC_CONTEST_END_TIME'
NEXT_PUBLIC_TIME_CONSTRAINT='$GH_NEXT_PUBLIC_TIME_CONSTRAINT'
NEXT_PUBLIC_CONTEST_RANGE_KEY='$GH_NEXT_PUBLIC_CONTEST_RANGE_KEY'
NEXT_PUBLIC_BASE_PATH='$GH_NEXT_PUBLIC_BASE_PATH'
NEXT_PUBLIC_IS_MAINTENANCE='$GH_NEXT_PUBLIC_IS_MAINTENANCE'
NEXT_PUBLIC_NEYNAR_CLIENT_ID='$GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID'
FRAMES_SECRET='$GH_FRAMES_SECRET'
NEYNAR_API_KEY='$GH_NEYNAR_API_KEY'
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ARG GH_NEXT_PUBLIC_CONTEST_END_TIME
ARG GH_NEXT_PUBLIC_TIME_CONSTRAINT
ARG GH_NEXT_PUBLIC_CONTEST_RANGE_KEY
ARG GH_NEXT_PUBLIC_BASE_PATH
ARG GH_NEXT_PUBLIC_IS_MAINTENANCE
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_FRAMES_SECRET
ARG GH_NEYNAR_API_KEY
Expand Down Expand Up @@ -49,6 +50,7 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_TIME_CONSTRAINT=${GH_NEXT_PUBLIC_TIME_CONSTRAINT} \
NEXT_PUBLIC_CONTEST_RANGE_KEY=${GH_NEXT_PUBLIC_CONTEST_RANGE_KEY} \
NEXT_PUBLIC_BASE_PATH=${GH_NEXT_PUBLIC_BASE_PATH} \
NEXT_PUBLIC_IS_MAINTENANCE=${GH_NEXT_PUBLIC_IS_MAINTENANCE} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
FRAMES_SECRET=${GH_FRAMES_SECRET} \
NEYNAR_API_KEY=${GH_NEYNAR_API_KEY} \
Expand Down Expand Up @@ -111,6 +113,7 @@ ARG GH_NEXT_PUBLIC_CONTEST_END_TIME
ARG GH_NEXT_PUBLIC_TIME_CONSTRAINT
ARG GH_NEXT_PUBLIC_CONTEST_RANGE_KEY
ARG GH_NEXT_PUBLIC_BASE_PATH
ARG GH_NEXT_PUBLIC_IS_MAINTENANCE
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_FRAMES_SECRET
ARG GH_NEYNAR_API_KEY
Expand Down Expand Up @@ -143,6 +146,7 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_TIME_CONSTRAINT=${GH_NEXT_PUBLIC_TIME_CONSTRAINT} \
NEXT_PUBLIC_CONTEST_RANGE_KEY=${GH_NEXT_PUBLIC_CONTEST_RANGE_KEY} \
NEXT_PUBLIC_BASE_PATH=${GH_NEXT_PUBLIC_BASE_PATH} \
NEXT_PUBLIC_IS_MAINTENANCE=${GH_NEXT_PUBLIC_IS_MAINTENANCE} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
FRAMES_SECRET=${GH_FRAMES_SECRET} \
NEYNAR_API_KEY=${GH_NEYNAR_API_KEY} \
Expand Down
16 changes: 16 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,23 @@ const nextConfig = {
]
},
async redirects() {
console.log(process.env.NEXT_PUBLIC_IS_MAINTENANCE)
if (process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true') {
return [
{
source: '/((?!maintenance).*)',
destination: '/maintenance',
permanent: false,
},
]
}

return [
{
source: '/maintenance',
destination: '/tg',
permanent: false,
},
{
source: '/report',
destination: 'https://forms.gle/Gjh3ELaNHTBotiwN7',
Expand Down
7 changes: 1 addition & 6 deletions src/pages/maintenance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ export default function MaintenancePage() {
<div className='flex h-screen w-full items-center justify-center bg-background px-8 text-center'>
<div className='flex flex-col gap-8'>
<Logo className='text-5xl' />
<div className='flex max-w-screen-sm flex-col gap-4'>
<div className='flex max-w-md flex-col gap-4'>
<p className='text-2xl font-semibold'>🛠️ Short Meme Break 🛠️</p>
<p className='text-text-muted'>
Our site is taking a quick breather while we improve your
meme-sharing experience! 💻
</p>
<p className='mt-2 text-text-muted'>
Don&apos;t worry, your amazing content is safe, and we&apos;ll be
back up and running before you know it. Hang tight and get ready to
unleash your next viral hit! 🌟
</p>
</div>
</div>
</div>
Expand Down

0 comments on commit c3b840f

Please sign in to comment.