-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (42 loc) · 1.51 KB
/
test-guide.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
name: Test WIS2 Guide build
on:
pull_request:
paths:
- '**.adoc'
env:
FILE_BASENAME: wis2-guide-DRAFT
jobs:
build-wis2-guide:
name: Test documentation build
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -y \
&& sudo apt-get install -y pandoc \
&& sudo gem install asciidoctor asciidoctor-pdf
- name: checkout repository
uses: actions/checkout@v3
- name: build documentation
run: |
mkdir -p /tmp/wis2-guide/guide/images \
&& cd guide \
&& asciidoctor --trace -o /tmp/wis2-guide/guide/${FILE_BASENAME}.html index.adoc \
&& asciidoctor --trace --backend docbook --out-file - index.adoc | pandoc --from docbook --to docx --output /tmp/wis2-guide/guide/${FILE_BASENAME}.docx \
&& asciidoctor --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-guide/guide/${FILE_BASENAME}.pdf index.adoc \
&& cp images/*.png /tmp/wis2-guide/guide/images \
&& cd ..
- name: checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: update gh-pages branch and publish
run: |
git checkout gh-pages
git config --global user.email "[email protected]"
git config --global user.name "Tom Kralidis"
rm -rf guide
mv -f /tmp/wis2-guide/* .
git add .
git commit -am "update WIS2 Guide build"
git push