forked from zaphosting/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.24 KB
/
build-docusaurus.yml
File metadata and controls
75 lines (67 loc) · 2.24 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
name: Build Docusaurus Documentation
on:
pull_request_target:
types: [labeled]
push:
branches: ["master", "main"]
permissions:
checks: write
contents: write
pull-requests: write
jobs:
build-docusaurus:
if: github.event_name == 'push' || github.event.label.name == 'BUILD DOCUSAURUS'
timeout-minutes: 1440
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build Docusaurus
run: |
npm run write-translations -- --locale de
npm run write-translations -- --locale es
npm run write-translations -- --locale fr
npm run write-translations -- --locale ar
npm run write-translations -- --locale pt
npm run write-translations -- --locale th
npm run write-translations -- --locale pl
npm run write-translations -- --locale ja
npm run write-translations -- --locale sv
npm run write-translations -- --locale it
npm run write-translations -- --locale nl
npm run write-translations -- --locale zh
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@v4
with:
name: build
path: build.tar
retention-days: 90
- name: Remove label
if: always() && github.event_name == 'pull_request_target'
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: 'BUILD DOCUSAURUS'
});
} catch (error) {
core.warning(`Could not remove label: ${error.message}`);
}