Skip to content

Build Registry

Build Registry #341

Workflow file for this run

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