-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (71 loc) · 1.92 KB
/
deploy-docs.yaml
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
name: Deploy docs
# This job builds and deploys documenation to github pages.
# It runs on every push to master with a change in the docs folder.
on:
push:
branches:
- main
paths:
- "docs/**"
- .github/workflows/deploy-docs.yaml
permissions:
contents: read
jobs:
Build-and-deploy:
permissions:
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
path: "."
- name: Compute diff 📜
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
docs/**/*.*
FILES: |
package.json
yarn.lock
- name: Setup Protoc 👷
if: env.GIT_DIFF
uses: arduino/setup-protoc@v3
with:
version: "24.0"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js 🔧
if: env.GIT_DIFF
uses: actions/setup-node@v4
with:
node-version: "16.x"
cache: 'yarn'
cache-dependency-path: |
yarn.lock
- name: Install 🔨
if: env.GIT_DIFF
run: yarn install --immutable
- name: Build packages 🔧
if: env.GIT_DIFF
run: yarn build
- name: Build docs 🔧
if: env.GIT_DIFF
env:
NODE_OPTIONS: "--max-old-space-size=4096"
run: yarn build-docs
- name: Prepare docs folder 🔧
if: env.GIT_DIFF
run: mv docs/build ~/output
- name: Deploy 🚀
if: env.GIT_DIFF
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ~/output
single-commit: true
clean: true
clean-excludes: |
CNAME