Simplify documentation #33
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run check | |
| deploy: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| concurrency: | |
| group: production | |
| cancel-in-progress: false | |
| environment: | |
| name: production | |
| url: ${{ vars.ARTIFACTS_URL }} | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| - run: npm ci | |
| - name: Restore deployment configuration | |
| env: | |
| CLOUDFLARE_WRANGLER_CONFIG: ${{ secrets.CLOUDFLARE_WRANGLER_CONFIG }} | |
| run: node scripts/write-deployment-config.mjs | |
| - name: Apply D1 migrations | |
| run: npx wrangler d1 migrations apply DB --remote --config wrangler.jsonc | |
| - name: Deploy service | |
| run: npm run deploy |