| 1 |
name: Deploy PAC Tester to GitHub Pages |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [main] |
| 6 |
paths: |
| 7 |
- "web/**" |
| 8 |
- "src/pac_utils.h" |
| 9 |
- "src/pac_utils_dump.c" |
| 10 |
- ".github/workflows/deploy-pages.yml" |
| 11 |
workflow_dispatch: |
| 12 |
|
| 13 |
permissions: |
| 14 |
contents: read |
| 15 |
pages: write |
| 16 |
id-token: write |
| 17 |
|
| 18 |
# Only one Pages deployment at a time. Cancel any in-progress run when a |
| 19 |
# newer one starts, preventing the "multiple github-pages artifacts" error |
| 20 |
# that occurs when two runs both reach the upload step concurrently. |
| 21 |
concurrency: |
| 22 |
group: pages |
| 23 |
cancel-in-progress: true |
| 24 |
|
| 25 |
jobs: |
| 26 |
deploy: |
| 27 |
environment: |
| 28 |
name: github-pages |
| 29 |
url: ${{ steps.deployment.outputs.page_url }} |
| 30 |
runs-on: ubuntu-latest |
| 31 |
steps: |
| 32 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 33 |
|
| 34 |
# Regenerate web/pac_utils.js from src/pac_utils.h so the deployed |
| 35 |
# site is always in sync even if someone forgot to run |
| 36 |
# `make -C src pac_utils_js` locally before committing. |
| 37 |
- name: Regenerate pac_utils.js |
| 38 |
run: make -C src pac_utils_js |
| 39 |
|
| 40 |
- name: Copy API docs to web/api |
| 41 |
run: | |
| 42 |
mkdir -p web/api |
| 43 |
cp -a docs/html/* web/api/ |
| 44 |
|
| 45 |
- uses: actions/configure-pages@v6 |
| 46 |
|
| 47 |
- uses: actions/upload-pages-artifact@v4 |
| 48 |
with: |
| 49 |
path: web/ |
| 50 |
|
| 51 |
- name: Deploy to GitHub Pages |
| 52 |
id: deployment |
| 53 |
uses: actions/deploy-pages@v5 |