Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Setup workflow to auto deploy fakerest and supabase demos.

Matthieu Hochlander48c9c7470b3b
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index c14cab70..c843013b 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -13,8 +13,48 @@ permissions:
contents: write
jobs:
- deploy:
- name: πŸš€ Deploy
+ deploy-demo:
+ name: πŸš€ Deploy (demo)
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ env:
+ VITE_IS_DEMO: true
+ VITE_INBOUND_EMAIL: ${{ vars.VITE_INBOUND_EMAIL }}
+ PRODUCTION_REMOTE: https://git:${{ secrets.DEPLOY_TOKEN || secrets.GITHUB_TOKEN }}@github.com/${{ vars.DEMO_DEPLOY_REPOSITORY }}
+ DEPLOY_REPOSITORY: ${{ vars.DEMO_DEPLOY_REPOSITORY }}
+
+ steps:
+ - name: πŸ“₯ Checkout repo
+ uses: actions/checkout@v4
+
+ - name: βš™οΈ Setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+
+ - name: βš™οΈ Setup git
+ run: |
+ echo Deploying to pages to $PRODUCTION_REMOTE
+ git remote set-url origin https://git:${{ secrets.GITHUB_TOKEN }}@github.com/${DEPLOY_REPOSITORY}
+ git remote add production $PRODUCTION_REMOTE
+ git config --global user.email [email protected]
+ git config --global user.name github-actions-bot
+
+ - name: πŸ“₯ Download deps
+ run: npm install
+
+ - name: πŸ”¨ Build
+ run: npm run build-demo
+
+ - name: πŸ“‘ Deploy GitHub pages
+ run: npx gh-pages --remote production -d dist -b ${{ vars.DEPLOY_BRANCH || 'gh-pages' }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN || secrets.GITHUB_TOKEN }}
+
+ deploy-supabase:
+ name: πŸš€ Deploy (supabase)
runs-on: ubuntu-latest
timeout-minutes: 10
@@ -58,7 +98,7 @@ jobs:
- name: πŸ”¨ Build
run: npm run build
-
+
- if: ${{ env.IS_SUPABASE_CONFIGURED }}
name: πŸ”— Supabase Link
run: npx supabase link --project-ref $SUPABASE_PROJECT_ID