Skip to content

v3.4 Taboo AI Gems & Shops #567

v3.4 Taboo AI Gems & Shops

v3.4 Taboo AI Gems & Shops #567

Workflow file for this run

name: Taboo AI Preview CI/CD
on:
# run when a pull request into main is opened or updated
pull_request:
branches:
- main
jobs:
lint_and_test:
name: Run linter and jest unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js v21.6.1
uses: actions/setup-node@v3
with:
node-version: v21.6.1
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run Jest unit tests
run: npm test
supabase_deploy:
name: Deploy preview supabase
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.STAGING_PROJECT_ID }}
SUPABASE_OAUTH_GOOGLE_CLIENT_ID: ${{ secrets.SUPABASE_OAUTH_GOOGLE_CLIENT_ID }}
SUPABASE_OAUTH_GOOGLE_CLIENT_SECRET: ${{ secrets.SUPABASE_OAUTH_GOOGLE_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase link --project-ref qbjkpfyfmnkerzcmmjbk
- run: supabase db push
supabase_test:
name: Supabase tests
runs-on: ubuntu-latest
needs: [ supabase_deploy ]
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_OAUTH_GOOGLE_CLIENT_ID: ${{ secrets.SUPABASE_OAUTH_GOOGLE_CLIENT_ID }}
SUPABASE_OAUTH_GOOGLE_CLIENT_SECRET: ${{ secrets.SUPABASE_OAUTH_GOOGLE_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Start Supabase local development setup
run: supabase start
- name: Verify generated types are checked in
run: |
supabase gen types typescript --project-id qbjkpfyfmnkerzcmmjbk --schema public > lib/supabase/__generated__/types.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet lib/supabase/__generated__/types.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
vercel_deploy:
name: Deploy preview on vercel
runs-on: ubuntu-latest
needs: [ lint_and_test, supabase_test ]
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz