-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.26 KB
/
build.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
name: Build
on:
- push
- pull_request
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Install asciidoctor
run: gem install asciidoctor
- name: Run tests
run: ruby -Ilib:test test/*.rb
publish-docs:
name: Publish docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout project sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build the docker image
run: docker build -t jakzal/asciidoctor .
- name: Build docs
run: |
version=$(cat asciidoctor-git-include.gemspec | grep 's.version' | sed -e 's/[^"]*"\([^"]*\)".*/\1/g')
sed -i'' -e 's/v1.0.0/v'$version'/g' examples/index.adoc
docker run -t --rm --name docs -u "$(id -u):$(id -g)" -v $(pwd):/project -w /project jakzal/asciidoctor asciidoctor -r asciidoctor-git-include examples/index.adoc -o examples/index.html
- name: Deploy docs
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: examples