-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (115 loc) · 4.43 KB
/
Copy pathdocs.yml
File metadata and controls
127 lines (115 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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"
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@v6
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