-
Notifications
You must be signed in to change notification settings - Fork 370
65 lines (56 loc) · 1.56 KB
/
build-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
57
58
59
60
61
62
63
64
65
name: Build docs on PR merge
on:
push:
branches:
- master
workflow_dispatch:
jobs:
merge_job:
runs-on: ubuntu-latest
concurrency:
group: build-docs
cancel-in-progress: true
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- uses: actions/setup-node@v2
with:
node-version: "18"
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/**/.cache
key: |
${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}
- name: Set Git config
run: |
git config --local user.email "actions@github.com"
git config --local user.name "Github Actions"
- name: Merge master back to build
run: |
git fetch
git checkout build
git pull
git merge --no-ff master -m "Auto-merge main back to build"
- name: Install dependencies and build
run: |
cd website
yarn
yarn build
yarn crowdin:upload
- name: Commit build
run: |
git add -f ./website/build ./website/.docusaurus ./website/i18n
if git commit -m "add new build";then
git push
else
echo "Nothing to commit"
fi
env:
NODE_OPTIONS: --max-old-space-size=8192
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}