-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 2.43 KB
/
Copy pathpages.yml
File metadata and controls
88 lines (77 loc) · 2.43 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build & Deploy Asciidoctor Pages
on:
push:
branches: ["**"] # build on all branches; deploy only from default branch
pull_request:
# GitHub Pages needs these permissions on the deploy job
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
# Use the same container image as in GitLab
container:
image: asciidoctor/docker-asciidoctor
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tools (apk) and Node.js
run: |
apk update
apk add --no-cache nodejs curl unzip tar
which node || true
- name: Install asciidoctor-chunker
working-directory: /tmp
run: |
curl -L -o asciidoctor-chunker_v1.0.4.zip \
https://github.com/wshito/asciidoctor-chunker/releases/download/v1.0.4/asciidoctor-chunker_v1.0.4.zip
unzip -p asciidoctor-chunker_v1.0.4.zip '*/asciidoctor-chunker.js' > /usr/bin/asciidoctor-chunker
chmod 0755 /usr/bin/asciidoctor-chunker
- name: Run Asciidoctor
run: |
asciidoctor -a data-uri \
-a reproducible \
-a icons=font \
-a source-highlighter=Pygments \
-a experimental \
-a stylesheet=$GITHUB_WORKSPACE/src/stylesheets/readthedocs-new.css \
-D /tmp \
-R src '**/*.adoc'
- name: Chunk HTML
run: |
mkdir -p public
asciidoctor-chunker \
--depth 1 \
--outdir public \
--titlePage '' \
/tmp/index.html
- name: Copy stylesheet to public
run: |
cp -v src/asciidoctor-chunker.css public || true
# Upload the 'public' folder as the artifact GitHub Pages will deploy
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
github.ref_name == github.event.repository.default_branch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4