Build Registry #341
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: Build Registry | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| schedule: | |
| # Upstream releases are picked up on the hour; the panel polls this index. | |
| - cron: "17 * * * *" | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: "Deploy even if nothing changed since the last deploy" | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: registry-build | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.diff.outputs.changed }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "22" | |
| - name: Validate entries | |
| run: node scripts/validate.mjs | |
| - name: Test | |
| run: node scripts/build.test.mjs | |
| - name: Build index | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node scripts/build.mjs | |
| # Most hourly builds reproduce what is already live; those skip the deploy. | |
| - name: Compare with the published registry | |
| id: diff | |
| if: github.event_name != 'pull_request' | |
| run: node scripts/changed.mjs | |
| - uses: actions/upload-pages-artifact@v5 | |
| if: github.event_name != 'pull_request' && (steps.diff.outputs.changed == 'true' || inputs.force == true) | |
| with: | |
| path: dist | |
| deploy: | |
| if: github.event_name != 'pull_request' && (needs.build.outputs.changed == 'true' || inputs.force == true) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 |