Skip to content

remove metronome

remove metronome #1962

Workflow file for this run

name: πŸš€ Deploy
on:
push:
branches:
- main
- dev
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: πŸ”Ž Determine deployable changes
runs-on: ubuntu-latest
outputs:
DEPLOYABLE: ${{steps.changes.outputs.DEPLOYABLE}}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: '50'
- name: βŽ” Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: πŸ”Ž Determine deployable changes
id: changes
run: >-
echo ::set-output name=DEPLOYABLE::$(node ./other/is-deployable.js ${{
github.sha }})
- name: ❓ Deployable
run: >-
echo "DEPLOYABLE: ${{steps.changes.outputs.DEPLOYABLE}}"
lint:
name: ⬣ ESLint
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: βŽ” Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ”¬ Lint
run: npm run lint
typecheck:
name: Κ¦ TypeScript
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: βŽ” Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ”Ž Type check
run: npm run typecheck
playwright:
name: 🎭 Playwright
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
continue-on-error: true
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: πŸ„ Copy test env vars
run: cp .env.example .env
- name: βŽ” Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: 🎬 Setup ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: 🌐 Install Playwright Browsers
run: npm run test:e2e:install
- name: πŸ›  Setup Database
run: npx prisma migrate reset --force
- name: πŸ— Build
run: npm run build
- name: 🏦 Prime Site Cache
id: site-cache
uses: actions/cache@v3
with:
path: other/cache.db
key: site-cache
- name: πŸ˜… Generate Site Cache
if: steps.site-cache.outputs.cache-hit != 'true'
run: npm run prime-cache:mocks
- name: 🎭 Playwright tests
run: npx playwright test
env:
PORT: 8811
- name: πŸ“Š Upload report
uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
deploy:
name: πŸš€ Deploy
runs-on: ubuntu-latest
needs: [changes, lint, typecheck]
# only build/deploy main branch on pushes
if:
${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
github.event_name == 'push' && needs.changes.outputs.DEPLOYABLE == 'true'
}}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: '50'
- name: πŸ‘€ Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: 'fly.toml'
field: 'app'
- name: 🎈 Setup Fly
uses: superfly/flyctl-actions/[email protected]
- name: πŸ€– update robots
if: ${{ github.ref == 'refs/heads/dev' }}
run:
# replace "Allow" with "Disallow" in public/robots.txt for staging
sed -i 's/Allow/Disallow/g' public/robots.txt
- name: πŸš€ Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run:
flyctl deploy --depot --remote-only --build-arg COMMIT_SHA=${{
github.sha }} --app ${{ steps.app_name.outputs.value }}-staging
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: πŸš€ Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
run:
flyctl deploy --depot --remote-only --build-arg COMMIT_SHA=${{
github.sha }} --build-secret SENTRY_AUTH_TOKEN=${{
secrets.SENTRY_AUTH_TOKEN }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}