Incrementing the binary targets #796
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: CI | |
env: | |
AUTH0_CLIENT_ID: ${{ vars.AUTH0_CLIENT_ID }} | |
AUTH0_DOMAIN: ${{ vars.AUTH0_DOMAIN }} | |
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
PUBLIC_AUTH0_CLIENT_ID: ${{ vars.PUBLIC_AUTH0_CLIENT_ID }} | |
PUBLIC_AUTH0_DOMAIN: ${{ vars.PUBLIC_AUTH0_DOMAIN }} | |
PUBLIC_AUTH0_AUDIENCE: ${{ vars.PUBLIC_AUTH0_AUDIENCE }} | |
PUBLIC_BUILD: ${{ github.ref_name }}-${{ github.run_number }} | |
PRISMA_FIELD_ENCRYPTION_KEY: ${{ secrets.PRISMA_FIELD_ENCRYPTION_KEY }} | |
PREVIEW_DOMAIN: notes-dev.dejanvasic.me | |
PUBLIC_BASE_URL: ${{ vars.PUBLIC_BASE_URL }} | |
SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
SES_AWS_ACCESS_KEY_ID: ${{ secrets.SES_AWS_ACCESS_KEY_ID }} | |
SES_AWS_SECRET_ACCESS_KEY: ${{ secrets.SES_AWS_SECRET_ACCESS_KEY }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
workflow_dispatch: | |
push: | |
branches-ignore: | |
- main | |
jobs: | |
build: | |
name: Check and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Add Svelte Check annotator | |
uses: prgm-dev/svelte-check-pr-annotator@main | |
- name: Run Svelte-Check | |
run: npm run check | |
- name: Run ESLint | |
run: npm run lint | |
- name: Run unit tests | |
run: npm run test:unit | |
test: | |
name: Test Playwright | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: npx playwright test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 7 | |
deploy_preview: | |
name: Deploy Preview | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
concurrency: preview_deploy | |
environment: | |
name: preview | |
url: https://${{ env.PREVIEW_DOMAIN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy | |
run: | | |
npm install --global vercel@canary | |
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" | |
vercel alias --token=${{ secrets.VERCEL_TOKEN }} set "$url" ${{ env.PREVIEW_DOMAIN }} | |
echo "deployment_url=$url" >> $GITHUB_ENV |