-
Notifications
You must be signed in to change notification settings - Fork 29
69 lines (66 loc) · 1.97 KB
/
Copy pathdocument.yml
File metadata and controls
69 lines (66 loc) · 1.97 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
name: documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
pull_request_target:
branches: [main]
jobs:
checks:
# Run workflow pull_request if it is not a fork.
# As pull_request_target if it is a fork.
if: >-
( github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork == true ) ||
( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Test Build
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run crowdin:sync
npm run build
gh-release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
DEPLOYMENT_BRANCH: gh-pages
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
run: |
git config --global user.email "nocalhost@nocalhost.dev"
git config --global user.name "nocalhost"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run crowdin:sync
npm run deploy