conf: change deploy action to take care of the new env vars. #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to prod | |
on: | |
push: | |
branches: | |
- "**" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: npm install | |
- name: Build the app | |
env: | |
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_API_URL }} | |
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
run: npm run build | |
- name: Link Supabase && init db && populate | |
env: | |
SUPABASE_PROJECT_REF: ${{ vars.SUPABASE_PROJECT_REF }} | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }} | |
run: | | |
npx supabase link --project-ref $SUPABASE_PROJECT_REF | |
npx tsx tools/populateDbWithFakeData.ts | |
- name: Upload to GitHub Pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
- name: 🚀 Deploy to github pages | |
uses: actions/deploy-pages@v4 |