Deploy to GitHub Pages #54
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| # 04:30 UTC daily, well after firmware (00:11) and builder (~07:20) | |
| # nightlies have settled. Cron format: minute hour dom month dow. | |
| - cron: "30 4 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - run: npm ci | |
| - run: npm test | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - run: npm ci | |
| # `npm run build` invokes `npm run prebuild` first, which uses the | |
| # built-in `gh` CLI to download `sizes.*.json` release assets from | |
| # OpenIPC/firmware and OpenIPC/builder, server-side. CORS is structurally | |
| # not a question during this step — only the in-browser fetches need to | |
| # stay same-origin. | |
| - run: npm run build | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |