forked from zaphosting/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.45 KB
/
build-docusaurus.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
name: Build Docusaurus
on:
push:
branches: ["master", "main"]
permissions:
checks: write
contents: write
jobs:
build-docusaurus:
runs-on: self-hosted
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
path: 'docusaurus'
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 19
- name: Install Docusaurus
run: |
cd docusaurus
npm install
- name: Build Docusaurus
run: |
cd docusaurus
rm -rf build
npm run docusaurus clear
rm -f build.tar
npm run build
tar cf build.tar -C build --transform 's~^\./~~' .
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: docusaurus/build.tar
retention-days: 90
- name: Update i18n files
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
cd docusaurus
npm run write-translations -- --locale de
git config user.name github-actions
git config user.email github-actions@github.com
git add --all .
git diff --exit-code && git commit -am "update i18n" || true
git push