Skip to content

Commit 3475a2d

Browse files
committed
Add docs build workflow
1 parent e08ea1e commit 3475a2d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build Indev Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
name: Build indev docs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v1
15+
16+
- name: Install Node v12
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 12
20+
21+
- name: Install dependencies
22+
run: |
23+
npm install
24+
25+
- name: Clone gh-pages branch
26+
run: git clone https://${{ github.actor }}:${{ secrets.DOCS_TOKEN }}@github.com/${{ github.repository }}.git -b gh-pages ../yamdbf-docs
27+
28+
- name: Build docs
29+
run: |
30+
npm run build
31+
npm run docs:indev
32+
33+
- name: Build localization string list
34+
run: npm run localization
35+
36+
- name: Check if commit is needed
37+
id: git_status
38+
run: |
39+
cd ../yamdbf-docs
40+
echo "##[set-output name=status;]$(git status | grep 'nothing to commit')"
41+
42+
- name: Make commit and push
43+
if: contains(steps.git_status.outputs.status, 'nothing to commit') != true
44+
run: |
45+
cd ../yamdbf-docs
46+
git config --global user.name "${{ github.actor }}"
47+
git config --global user.email "${{ github.actor}}@users.noreply.github.com"
48+
git add --all
49+
git commit -m "Build docs from master: ${{ github.sha }}"
50+
git push origin gh-pages

0 commit comments

Comments
 (0)