fix(deploy): build via npm run build so the fetch scripts run in CI #3
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: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Check & build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| # FR-4: the fetch step runs inside `npm run build` and must FAIL LOUDLY | |
| # if a pinned engine document moved. Keeping it as an explicit step makes | |
| # the failure legible in Checks. | |
| - name: Fetch engine docs, release, discussions | |
| run: npm run fetch | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Type check | |
| run: npm run check | |
| - name: Build | |
| run: npx astro build | |
| - name: Upload site artifact (for PR inspection) | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: site-preview | |
| path: dist | |
| retention-days: 7 |