migrate sentry to react router v7 #268
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 | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
lint: | |
name: π§Ά ESLint | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: π Checkout repo | |
uses: actions/checkout@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
run_install: true | |
- name: π§Ά Lint | |
run: pnpm lint | |
typecheck: | |
name: π¬ TypeScript | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: π Checkout repo | |
uses: actions/checkout@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
run_install: true | |
- name: π¬ Type check | |
run: pnpm typecheck | |
vitest: | |
name: β‘ Vitest | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: π Checkout repo | |
uses: actions/checkout@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
run_install: true | |
- name: β‘ Run vitest | |
run: pnpm coverage | |
migration: | |
name: 𧬠Migration | |
runs-on: ubuntu-22.04 | |
needs: [lint, typecheck, vitest] | |
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev'}} | |
steps: | |
- name: π Checkout repo | |
uses: actions/checkout@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
run_install: true | |
- name: 𧬠Staging Migration | |
if: ${{ github.ref_name == 'dev'}} | |
run: pnpm db:migrate | |
env: | |
TURSO_DB_URL: ${{ secrets.STAGING_TURSO_DB_URL }} | |
TURSO_DB_AUTH_TOKEN: ${{ secrets.STAGING_TURSO_DB_AUTH_TOKEN }} | |
- name: 𧬠Production Migration | |
if: ${{ github.ref_name == 'main'}} | |
run: pnpm db:migrate | |
env: | |
TURSO_DB_URL: ${{ secrets.TURSO_DB_URL }} | |
TURSO_DB_AUTH_TOKEN: ${{ secrets.TURSO_DB_AUTH_TOKEN }} | |
deploy: | |
name: π Deploy | |
runs-on: ubuntu-22.04 | |
needs: [lint, typecheck, vitest, migration] | |
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev'}} | |
steps: | |
- name: π Checkout repo | |
uses: actions/checkout@v4 | |
- name: π Setup Fly | |
uses: superfly/flyctl-actions/[email protected] | |
- name: π Deploy Staging | |
if: ${{ github.ref_name == 'dev'}} | |
run: flyctl deploy --remote-only --config fly.staging.toml | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: π Deploy Production | |
if: ${{ github.ref_name == 'main'}} | |
run: > | |
flyctl deploy --remote-only --build-secret SENTRY_AUTH_TOKEN=${{ | |
secrets.SENTRY_AUTH_TOKEN }} --build-arg SENTRY_ORG="samuel-jensen" | |
--build-arg SENTRY_PROJECT="nichtsam-com" --build-arg COMMIT_SHA=${{ | |
github.sha }} | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |