-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (97 loc) · 3.74 KB
/
Copy pathdocs.yml
File metadata and controls
109 lines (97 loc) · 3.74 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
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/**"
- "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
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache: true
# 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@v4
with:
path: ${{ runner.temp }}/demo-cells
key: demo-cells-${{ hashFiles('scripts/fetch-demo-cells.sh', '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@v4
with:
path: ${{ runner.temp }}/preslib-cells
key: preslib-cells-${{ hashFiles('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/. Needs the S-101
# catalogue (IHO material kept out of the repo): clone it and let `make build`
# (a dep of `make demo`) embed it. The bundle is pure static files — no backend.
- name: Build live demo bundle (docs/static/demo)
run: |
git clone --depth 1 https://github.com/iho-ohi/S-101_Portrayal-Catalogue.git "$RUNNER_TEMP/s101-pc"
git clone --depth 1 https://github.com/iho-ohi/S-101-Documentation-and-FC.git "$RUNNER_TEMP/s101-fc"
make demo \
S101_PC="$RUNNER_TEMP/s101-pc/PortrayalCatalog" \
S101_FC="$RUNNER_TEMP/s101-fc/S-101FC/FeatureCatalogue.xml" \
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. Reuses the S-101 catalogue
# cloned above; the source cells come from the IHO PresLib draft (fetched once).
- name: Build live Chart 1 tiles (docs/static/chart1)
run: |
make demo-chart1 \
S101_PC="$RUNNER_TEMP/s101-pc/PortrayalCatalog" \
S101_FC="$RUNNER_TEMP/s101-fc/S-101FC/FeatureCatalogue.xml" \
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: docs/package-lock.json
- name: Install
working-directory: docs
run: npm ci
- name: Build
working-directory: docs
run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: 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