-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.16 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
name: publish docs
on:
release:
types: [published]
workflow_dispatch:
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
- name: Checkout gh-pages
uses: actions/checkout@v3
with:
ref: gh-pages
path: "./gh-pages"
- name: Fix folder structure
run: mv gh-pages/docs docs
continue-on-error: true
- name: Clean up gh-pages
run: rm -rf gh-pages
- name: Setup node.js @ lts
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-lts/*-build-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: npm ci
- name: Generate API reference
run: npm run docs
- name: Publish to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
target-folder: docs