-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (49 loc) · 1.75 KB
/
publish-docs.yml
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
name: Publish documentation
on:
push:
branches:
- main
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v4
- name: Read package.json
id: package_json
uses: zoexx/github-action-json-file-properties@1.0.6
with:
file_path: 'package.json'
- name: Install Node and NPM
uses: actions/setup-node@v4
with:
node-version: ${{ fromJson(steps.package_json.outputs.volta).node }}
cache: npm
- name: Install packages and build
run: |
npm ci
npm run build
- name: Build documentation
run: | # need to specify --out so pages links at /{their name} instead of at /docs
cd lib/platform-bible-react
npm run build:docs -- --out platform-bible-react
cd ../platform-bible-utils
npm run build:docs -- --out platform-bible-utils
cd ../papi-dts
npm run build:docs -- --out papi-dts
cd ../../
mkdir docs-for-pages
mv lib/platform-bible-react/platform-bible-react docs-for-pages
mv lib/platform-bible-utils/platform-bible-utils docs-for-pages
mv lib/papi-dts/papi-dts docs-for-pages
- name: Add nojekyll # needed so that HTML pages that start with _ do not cause 404
run: touch docs-for-pages/.nojekyll
- name: Add landing page
run: |
cp .github/assets/github-pages-index.html docs-for-pages
mv docs-for-pages/github-pages-index.html docs-for-pages/index.html
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: github-pages
folder: docs-for-pages