-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.56 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
name: Publish documentation
on:
push:
branches:
- main
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Read package.json
id: package_json
uses: zoexx/github-action-json-file-properties@release
with:
file_path: 'package.json'
- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: ${{ fromJson(steps.package_json.outputs.volta).node }}
cache: npm
- name: Install and build
run: |
npm install
npm run build
- name: Build documentation
run: | # need to specify --out so pages links at /{their name} instead of at /docs
cd lib/papi-components
npm run build:docs -- --out papi-components
cd ../papi-dts
npm run build:docs -- --out papi-dts
cd ../../
mkdir docs-for-pages
mv lib/papi-components/papi-components 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/[email protected]
with:
branch: github-pages
folder: docs-for-pages