Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Demo Branch from Main #10

Merged
merged 10 commits into from
Mar 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: πŸš€ Deploy to Vercel

on:
push:
branches:
- main
- demo
- '**'
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install --legacy-peer-deps

# Build step for demo branch
- name: Build for Vercel (demo)
if: ${{ github.ref_name == 'demo' }}
env:
SUPABASE_ANON_KEY: ${{ secrets.DEPLOY_DEMO_SUPABASE_ANON_KEY }}
SUPABASE_URL: ${{ secrets.DEPLOY_DEMO_SUPABASE_URL }}
DL_SUPABASE_PROJECT: ${{ secrets.DEPLOY_DEMO_DL_SUPABASE_PROJECT }}
DL_DNSDUMP_URL: ${{ secrets.DEPLOY_PROD_DL_DNSDUMP_URL }}
DL_PREFERRED_SUBDOMAIN_PROVIDER: ${{ secrets.DEPLOY_PROD_DL_PREFERRED_SUBDOMAIN_PROVIDER }}
DL_SHODAN_URL: ${{ secrets.DEPLOY_PROD_DL_SHODAN_URL }}
NITRO_PRESET: 'vercel'
DL_ENV_TYPE: 'demo'
run: |
NODE_OPTIONS=--max-old-space-size=8192 npm run build:vercel

# Build step for all other branches (prod/feature)
- name: Build for Vercel (prod/feature)
if: ${{ github.ref_name != 'demo' }}
env:
DL_STRIPE_CANCEL_URL: ${{ secrets.DEPLOY_PROD_DL_STRIPE_CANCEL_URL }}
DL_STRIPE_CHECKOUT_URL: ${{ secrets.DEPLOY_PROD_DL_STRIPE_CHECKOUT_URL }}
SUPABASE_ANON_KEY: ${{ secrets.DEPLOY_PROD_SUPABASE_ANON_KEY }}
SUPABASE_URL: ${{ secrets.DEPLOY_PROD_SUPABASE_URL }}
DL_SUPABASE_PROJECT: ${{ secrets.DEPLOY_PROD_DL_SUPABASE_PROJECT }}
DL_DNSDUMP_URL: ${{ secrets.DEPLOY_PROD_DL_DNSDUMP_URL }}
DL_PREFERRED_SUBDOMAIN_PROVIDER: ${{ secrets.DEPLOY_PROD_DL_PREFERRED_SUBDOMAIN_PROVIDER }}
DL_SHODAN_URL: ${{ secrets.DEPLOY_PROD_DL_SHODAN_URL }}
NITRO_PRESET: 'vercel'
DL_ENV_TYPE: 'managed'
run: |
NODE_OPTIONS=--max-old-space-size=8192 npm run build:vercel

- name: Deploy to Vercel
if: ${{ success() }}
run: |
npm install -g vercel
if [ "${{ github.ref_name }}" = "main" ]; then
echo "Deploying to production"
vercel deploy --prebuilt --prod --confirm --token $VERCEL_TOKEN
elif [ "${{ github.ref_name }}" = "demo" ]; then
echo "Deploying to demo"
vercel deploy --prebuilt --confirm --env NEXT_PUBLIC_SITE=demo --token $VERCEL_TOKEN
else
echo "Deploying to feature environment"
vercel deploy --prebuilt --confirm --env NEXT_PUBLIC_SITE=feature --token $VERCEL_TOKEN
fi
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

19 changes: 19 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Pushes the contents of the repo to the Codeberg mirror
name: πŸͺž Mirror to Codeberg
on:
workflow_dispatch:
schedule:
- cron: '30 0 * * 0'
push:
branches: [ 'main' ]
tags: [ 'v*' ]
jobs:
codeberg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@codeberg.org:alicia/domain-locker.git
ssh_private_key: ${{ secrets.CODEBERG_SSH }}
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ jobs:
token: ${{ secrets.BOT_TOKEN }}
tag: ${{ github.ref_name }}
writeToFile: false
includeInvalidCommits: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "supabase"]
path = supabase
url = https://github.com/Lissy93/dl-sb-iac
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ WORKDIR /app

# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm ci
RUN npm ci --legacy-peer-deps

# Copy application source code
COPY . .
Loading