jandes-79: Deploy demo app to cloudflare workers #22
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [mainline] | |
| pull_request: | |
| branches: [mainline] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changeset: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Changeset status (fail if missing) | |
| env: | |
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: | | |
| pnpm exec changeset status --since=origin/"${DEFAULT_BRANCH:-main}" > /tmp/changeset-status.txt | |
| cat /tmp/changeset-status.txt | |
| if grep -q "No changesets present" /tmp/changeset-status.txt; then | |
| echo "Missing changeset for this PR" | |
| exit 1 | |
| fi | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| env: | |
| VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }} | |
| VITE_SENTRY_ORG: ${{ vars.VITE_SENTRY_ORG }} | |
| VITE_SENTRY_PROJECT: ${{ vars.VITE_SENTRY_PROJECT }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Build | |
| run: pnpm build | |
| test: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| env: | |
| VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }} | |
| VITE_SENTRY_ORG: ${{ vars.VITE_SENTRY_ORG }} | |
| VITE_SENTRY_PROJECT: ${{ vars.VITE_SENTRY_PROJECT }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Unit tests | |
| run: pnpm test |