-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 2.36 KB
/
docs.yml
File metadata and controls
89 lines (76 loc) · 2.36 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
name: Publish docs
on:
workflow_dispatch: {}
workflow_call: {}
release:
types: [published]
permissions:
contents: write # allows the 'Commit' step without tokens
jobs:
get_history: # create an artifact from the existing documentation builds
runs-on: ubuntu-latest
steps:
- name: get the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages
- name: tar the existing docs
run: |
mkdir -p ./docs
tar -cvf documentation.tar ./docs
- name: create a document artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: documentation.tar
build: # builds the distribution and then the documentation
needs: get_history
runs-on: ubuntu-latest
steps:
- name: Checkout src
uses: actions/checkout@v3
- run: mkdir -p ./docs
- name: Download the existing documents artifact
uses: actions/download-artifact@v3
with:
name: documentation
- run: tar -xf documentation.tar ./docs -C ./docs
- uses: pnpm/action-setup@v2
with:
version: 7.30.3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build docs
run: pnpm run build:docs
- name: tar the new docs
run: tar -cvf newdocumentation.tar ./docs
- name: create a new document artifact
uses: actions/upload-artifact@v3
with:
name: newdocumentation
path: newdocumentation.tar
commit: # commit the old and new merged documents to gh-pages/docs
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages
- run: mkdir -p ./docs
- name: Download the new documents artifact
uses: actions/download-artifact@v3
with:
name: newdocumentation
- run: tar -xf newdocumentation.tar ./docs -C ./docs
- name: commit
run: |
git config --global user.email "username@users.noreply.github.com"
git config --global user.name "Continuous Integration"
git add ./docs
git commit -m "CI updated the documentation"
git push