Repository navigation
93 lines (93 loc) · 2.92 KB
/
Copy pathdocs.yml
File metadata and controls
93 lines (93 loc) · 2.92 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
88
89
90
91
92
93
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
name: Documentation (casket-ssg)
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
on:
push:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1
- name: Checkout casket-ssg
uses: actions/checkout@v7.0.1
with:
repository: hyperpolymath/casket-ssg
ref: cec3c20d80ea1dc93660b69a4e7b38aa49f2a56b
path: casket-ssg
persist-credentials: false
- name: Set up GHC
uses: haskell-actions/setup@v2.12.1
with:
ghc-version: '9.8.2'
cabal-version: '3.10'
- name: Cache Cabal
uses: actions/cache@v6.1.0
with:
path: |
~/.cabal/packages
~/.cabal/store
casket-ssg/dist-newstyle
key: ${{ runner.os }}-casket-${{ hashFiles('casket-ssg/**/*.hs') }}
restore-keys: |
${{ runner.os }}-casket-
- name: Build casket-ssg
working-directory: casket-ssg
run: |
cabal update
cabal build --index-state=2026-09-06T00:00:00Z
- name: Install AsciiDoc conversion tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends asciidoctor pandoc
- name: Convert documentation sources for Casket
run: |
set -euo pipefail
mkdir -p .docs-source docs/_site
# Casket accepts Markdown. Preserve AsciiDoc semantics through DocBook.
for source in docs/content/*.adoc; do
name=$(basename "$source" .adoc)
asciidoctor -b docbook5 -o "${RUNNER_TEMP}/${name}.xml" "$source"
pandoc -f docbook -t markdown "${RUNNER_TEMP}/${name}.xml" -o ".docs-source/${name}.md"
done
- name: Build documentation with Casket
working-directory: casket-ssg
run: |
cabal run --index-state=2026-09-06T00:00:00Z casket-ssg -- build ../.docs-source ../docs/_site
test -s ../docs/_site/index.html
touch ../docs/_site/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v5.0.0
with:
path: docs/_site
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5.0.1