-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.75 KB
/
build-asciidoc.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
# Many thanks to James Read:
# https://blog.jread.com/auto-build-and-host-pretty-html-documentation-using-asciidoc-github-pages-github-actions-758a03f93d7d
name: Build asciidocs
on:
push:
branches:
- master
jobs:
adoc_build:
runs-on: ubuntu-latest
name: Asciidoctoring the docs to pretty HTML!
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get build container
id: adocbuild
uses: avattathil/asciidoctor-action@4feb0f72ff1096f854daa6bb0b2456c2ecab27f9
with:
# If gitignore includes HTML files, it won't add our newly-generated HTML
# to the gh-pages branch.
program: "echo '!index.html' >> training/.gitignore && mkdir -p training2 && asciidoctor -o training/index.html training/rest_training.adoc && cp training/index.html training2"
- name: Deploy to github pages.
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Cannot publish to master from master, otherwise generated files would end up alongside
# their source files. The repo is configured to publish from gh-pages branch
# (Settings -> Pages).
publish_branch: gh-pages
# Publish the whole tree. The default is /public.
publish_dir: ./
# This is the default. Flush gh-pages branch before publishing.
keep_files: false
# Keep producing an index.html from README.md please.
enable_jekyll: true
# There is no point in keeping the history of the gh-pages branch.
# If you switch to gh-pages locally, you'll later have a problem merging.
# Delete your local branch to unblock.
force_orphan: true