-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.59 KB
/
doc.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
55
56
57
58
59
60
61
62
name: Documentation to PDF
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: '2'
# Install Asciidoctor
- name: Install Asciidoctor
run: |
sudo gem install asciidoctor-pdf
sudo gem install rouge
# Remove Images from the Internet
- name: Remove Images from the Internet
run: |
SRC="image:http.*"
RPL=""
sed -i "s/$SRC/$RPL/" README.adoc
echo | cat README.adoc
# Build PDF and copy it to the package
- name: Build the PDF
run: |
asciidoctor-pdf README.adoc
cp README.pdf python_tools/README.pdf
# Commit the documentation
- name: Commit README.pdf
id: commit
run: |
git config --local user.email "action[bot]@github.com"
git config --local user.name "github-actions[bot]"
git add README.pdf
git add python_tools/README.pdf
if [-z "$(git status --porcelain)"]; then
echo "::set-output name=push::false"
else
git commit -m "[bot] updated README.pdf"
echo "::set-output name=push::true"
fi
shell: bash
# Push the commit
- name: Push Commit
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SECRET_TOKEN }}