-
Notifications
You must be signed in to change notification settings - Fork 306
89 lines (78 loc) · 2.57 KB
/
doc_ci.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
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: Documentation CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
paths:
- 'website/**'
- '.github/**'
- '.yarn/**'
- .yarnrc.yml
- .npmignore
- .gitignore
concurrency:
group: doc-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4 # If you're using actions/checkout@v3 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
fetch-depth: 20
fetch-tags: false
- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
path: |
website/node_modules
website/.yarn
key: ${{ runner.os }}-build-doc-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-doc
- name: Install 🔧
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
run: yarn
working-directory: website
- name: Build 🔨
run: yarn build
working-directory: website
build-and-deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4 # If you're using actions/checkout@v3 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
fetch-depth: 20
fetch-tags: false
- name: Restore cached node modules ♻️
id: cache-yarn
uses: actions/cache@v4
with:
path: |
website/node_modules
website/.yarn
key: ${{ runner.os }}-build-doc-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-doc
- name: Install 🔧
if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }}
run: yarn
working-directory: website
- name: Build 🔨
run: yarn build
working-directory: website
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: website/build # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch