Skip to content

Commit 282674d

Browse files
authored
Merge pull request #14 from Lissy93/bot/update-demo
Update Demo Branch from Main
2 parents 77f98a8 + b4e4519 commit 282674d

File tree

13 files changed

+1256
-3094
lines changed

13 files changed

+1256
-3094
lines changed

.github/workflows/deploy.yml

+30-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
name: 🚀 Deploy to Vercel
2-
32
on:
43
push:
54
branches:
65
- main
76
- demo
87
- '**'
98
workflow_dispatch:
9+
inputs:
10+
branch:
11+
description: "Which branch do you want to deploy from?"
12+
required: false
13+
default: ""
1014

1115
jobs:
1216
build-and-deploy:
1317
runs-on: ubuntu-latest
1418

1519
steps:
20+
- name: Determine branch
21+
id: determine_branch
22+
run: |
23+
# If this workflow is triggered manually AND a branch input is provided,
24+
# use that. Otherwise, fall back to the automatically provided ref_name.
25+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.branch }}" != "" ]; then
26+
echo "branchName=${{ inputs.branch }}" >> $GITHUB_OUTPUT
27+
else
28+
echo "branchName=${{ github.ref_name }}" >> $GITHUB_OUTPUT
29+
fi
30+
1631
- name: Check out code
1732
uses: actions/checkout@v3
33+
with:
34+
# Check out the branch from the previous step.
35+
ref: ${{ steps.determine_branch.outputs.branchName }}
1836

1937
- name: Use Node.js
2038
uses: actions/setup-node@v3
@@ -26,22 +44,24 @@ jobs:
2644

2745
# Build step for demo branch
2846
- name: Build for Vercel (demo)
29-
if: ${{ github.ref_name == 'demo' }}
47+
if: ${{ steps.determine_branch.outputs.branchName == 'demo' }}
3048
env:
3149
SUPABASE_ANON_KEY: ${{ secrets.DEPLOY_DEMO_SUPABASE_ANON_KEY }}
3250
SUPABASE_URL: ${{ secrets.DEPLOY_DEMO_SUPABASE_URL }}
3351
DL_SUPABASE_PROJECT: ${{ secrets.DEPLOY_DEMO_DL_SUPABASE_PROJECT }}
3452
DL_DNSDUMP_URL: ${{ secrets.DEPLOY_PROD_DL_DNSDUMP_URL }}
3553
DL_PREFERRED_SUBDOMAIN_PROVIDER: ${{ secrets.DEPLOY_PROD_DL_PREFERRED_SUBDOMAIN_PROVIDER }}
3654
DL_SHODAN_URL: ${{ secrets.DEPLOY_PROD_DL_SHODAN_URL }}
55+
DL_DEMO_USER: ${{ secrets.DEPLOY_DEMO_DL_DEMO_USER }}
56+
DL_DEMO_PASS: ${{ secrets.DEPLOY_DEMO_DL_DEMO_PASS }}
3757
NITRO_PRESET: 'vercel'
3858
DL_ENV_TYPE: 'demo'
3959
run: |
4060
NODE_OPTIONS=--max-old-space-size=8192 npm run build:vercel
4161
42-
# Build step for all other branches (prod/feature)
62+
# Build step for main or other branches
4363
- name: Build for Vercel (prod/feature)
44-
if: ${{ github.ref_name != 'demo' }}
64+
if: ${{ steps.determine_branch.outputs.branchName != 'demo' }}
4565
env:
4666
DL_STRIPE_CANCEL_URL: ${{ secrets.DEPLOY_PROD_DL_STRIPE_CANCEL_URL }}
4767
DL_STRIPE_CHECKOUT_URL: ${{ secrets.DEPLOY_PROD_DL_STRIPE_CHECKOUT_URL }}
@@ -60,18 +80,18 @@ jobs:
6080
if: ${{ success() }}
6181
run: |
6282
npm install -g vercel
63-
if [ "${{ github.ref_name }}" = "main" ]; then
83+
BRANCH="${{ steps.determine_branch.outputs.branchName }}"
84+
if [ "$BRANCH" = "main" ]; then
6485
echo "Deploying to production"
65-
vercel deploy --prebuilt --prod --confirm --token $VERCEL_TOKEN
66-
elif [ "${{ github.ref_name }}" = "demo" ]; then
86+
npx vercel deploy --prebuilt --prod --yes --token $VERCEL_TOKEN
87+
elif [ "$BRANCH" = "demo" ]; then
6788
echo "Deploying to demo"
68-
vercel deploy --prebuilt --confirm --env NEXT_PUBLIC_SITE=demo --token $VERCEL_TOKEN
89+
npx vercel deploy --prebuilt --yes --target=demo --token $VERCEL_TOKEN
6990
else
7091
echo "Deploying to feature environment"
71-
vercel deploy --prebuilt --confirm --env NEXT_PUBLIC_SITE=feature --token $VERCEL_TOKEN
92+
npx vercel deploy --prebuilt --yes --target=staging --token $VERCEL_TOKEN
7293
fi
7394
env:
7495
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
7596
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
7697
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
77-

.github/workflows/mirror.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
schedule:
66
- cron: '30 0 * * 0'
77
push:
8-
branches: [ 'main' ]
98
tags: [ 'v*' ]
109
jobs:
1110
codeberg:

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ RUN npm run build
2323
# ──────────────────────────────────────────────────────────────
2424
FROM node:20-alpine AS runner
2525

26+
# Install PostgreSQL client
27+
RUN apk add --no-cache postgresql-client
28+
2629
# Set working directory
2730
WORKDIR /app
2831

0 commit comments

Comments
 (0)