Merge pull request #50 from beetlebugorg/chore/remove-stale-web-tests #46
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: Docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - ".github/workflows/docs.yml" | |
| # The live demo is built from the app + bake pipeline and deployed under the | |
| # docs site, so redeploy when any of those change too. | |
| - "web/**" | |
| - "cmd/**" | |
| - "internal/**" | |
| - "pkg/**" | |
| - "scripts/fetch-demo-cells.sh" | |
| - "Makefile" | |
| - "go.mod" | |
| - "go.sum" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment; cancel in-progress runs. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| # The demo + Chart 1 tiles are baked by the chartplotter binary, which links the | |
| # native libtile57 engine — so this build needs the ./tile57 engine submodule (its | |
| # own submodules fetch the IHO S-101 catalogues from the IHO's own repos) and the | |
| # Zig toolchain, same as ci.yml. `submodules: recursive` checks it out at the | |
| # committed pin, then it's floated to the engine's latest main (matching go.mod's | |
| # ./tile57/bindings/go replace). | |
| # NOTE: correct-by-construction but unvalidated until pushed to GitHub. | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout chartplotter (+ tile57 engine submodule) | |
| uses: actions/checkout@v7 | |
| with: | |
| path: chartplotter | |
| submodules: recursive | |
| - name: Float tile57 submodule to latest main | |
| run: | | |
| git -C chartplotter submodule update --remote tile57 | |
| git -C chartplotter submodule update --init --recursive tile57 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.26.5" | |
| cache: true | |
| cache-dependency-path: chartplotter/go.sum | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Build libtile57 | |
| run: make -C chartplotter tile57-lib | |
| # Cache the curated NOAA demo-cell downloads (one per band over Annapolis), | |
| # keyed on the cell list / fetch script so a change re-downloads. Lets the | |
| # bake reuse the same cells across runs. | |
| - name: Cache demo ENC cells | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ runner.temp }}/demo-cells | |
| key: demo-cells-${{ hashFiles('chartplotter/scripts/fetch-demo-cells.sh', 'chartplotter/Makefile') }} | |
| # Cache the S-52 PresLib "ECDIS Chart 1" source cells (the IHO draft zip is | |
| # fetched once and extracted), keyed on the fetch script so a change re-pulls. | |
| - name: Cache PresLib Chart 1 cells | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ runner.temp }}/preslib-cells | |
| key: preslib-cells-${{ hashFiles('chartplotter/scripts/fetch-preslib-cells.sh') }} | |
| # Build the read-only widget demo bundle into docs/static/demo so Docusaurus | |
| # copies it into the published site at /chartplotter/demo/. The S-101 | |
| # catalogue is embedded in libtile57 (fetched via the tile57 submodules | |
| # above), so no catalogue clone or --s101 override is needed. The bundle is | |
| # pure static files — no backend. | |
| - name: Build live demo bundle (docs/static/demo) | |
| run: | | |
| make -C chartplotter demo \ | |
| DEMO_CACHE="$RUNNER_TEMP/demo-cells" \ | |
| DEMO_OUT="docs/static/demo" | |
| # Bake the S-52 "ECDIS Chart 1" reference sheet to tiles into docs/static/chart1 | |
| # (published at /chartplotter/chart1/). The symbol-compliance docs page embeds | |
| # it live, reusing the demo bundle's frontend assets; the source cells come | |
| # from the IHO PresLib draft (fetched once). | |
| - name: Build live Chart 1 tiles (docs/static/chart1) | |
| run: | | |
| make -C chartplotter demo-chart1 \ | |
| PRESLIB_CACHE="$RUNNER_TEMP/preslib-cells" \ | |
| DEMO_CHART1_OUT="docs/static/chart1" | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: chartplotter/docs/package-lock.json | |
| - name: Install | |
| working-directory: chartplotter/docs | |
| run: npm ci | |
| - name: Build | |
| working-directory: chartplotter/docs | |
| run: npm run build | |
| - uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: chartplotter/docs/build | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |