Deploy Site #76
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: Deploy Site | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'site/**' | |
| - '.github/workflows/deploy-site.yml' | |
| # Rebuild when conformance tests complete (new release data available) | |
| workflow_run: | |
| workflows: ["Kernel Conformance"] | |
| types: [completed] | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: site/package-lock.json | |
| - name: Download latest conformance data | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mkdir -p site/public/data | |
| # Try to download from latest release, skip if none exists | |
| if gh release download --pattern 'conformance-matrix.json' --dir site/public/data 2>/dev/null; then | |
| echo "Downloaded conformance data from release" | |
| else | |
| echo "No release found, site will show loading state" | |
| fi | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: site | |
| - name: Build site | |
| run: npm run build | |
| working-directory: site | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site/out | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |