Skip to content

Commit ec1199b

Browse files
ci: deploy docs via Ddraig SSG (#10)
Mass rollout for Ddraig SSG
1 parent f7e0a33 commit ec1199b

1 file changed

Lines changed: 23 additions & 60 deletions

File tree

.github/workflows/pages.yml

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,53 @@
1-
# SPDX-License-Identifier: MPL-2.0
2-
# GitHub Pages via casket-ssg (hyperpolymath's pure-Haskell static site generator).
3-
# Replaces the orphan one-off Pages deployment with a reproducible build.
4-
name: GitHub Pages
5-
1+
name: GitHub Pages (Ddraig SSG)
62
on:
73
push:
8-
branches: [main]
4+
branches: [main, master]
95
workflow_dispatch:
10-
116
permissions:
127
contents: read
138
pages: write
149
id-token: write
15-
16-
# Serialise Pages deploys; never cancel an in-flight deploy.
1710
concurrency:
1811
group: "pages"
1912
cancel-in-progress: false
20-
2113
jobs:
2214
build:
23-
timeout-minutes: 20
2415
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
container:
18+
image: ghcr.io/stefan-hoeck/idris2-pack@sha256:f0758996a931fb35d9ecb1de273c4d59dabe2a09b433afc7e357f65a08b7e1ff
2519
steps:
26-
- name: Checkout
27-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
28-
29-
- name: Checkout casket-ssg
30-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20+
- name: Checkout Site
21+
uses: actions/checkout@v4
22+
- name: Checkout Ddraig SSG
23+
uses: actions/checkout@v4
3124
with:
32-
repository: hyperpolymath/casket-ssg
33-
path: .casket-ssg
34-
35-
- name: Setup GHCup
36-
uses: haskell-actions/setup@cd0d9bdd65b20557f41bea4dbe43d0b5fbbfe553 # v2.11.0
37-
with:
38-
ghc-version: '9.8.2'
39-
cabal-version: '3.10'
40-
41-
- name: Cache Cabal
42-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v4
43-
with:
44-
path: |
45-
~/.cabal/packages
46-
~/.cabal/store
47-
.casket-ssg/dist-newstyle
48-
key: ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }}
49-
50-
- name: Build casket-ssg
51-
working-directory: .casket-ssg
52-
run: cabal build
53-
25+
repository: hyperpolymath/ddraig-ssg
26+
path: .ddraig-ssg
27+
- name: Compile Ddraig
28+
working-directory: .ddraig-ssg
29+
run: idris2 Ddraig.idr -o ddraig
5430
- name: Build site
5531
run: |
56-
mkdir -p site _site
57-
# Seed site/index.md from README if the author hasn't provided one.
58-
if [ ! -f site/index.md ]; then
59-
{
60-
echo "---"
61-
echo "title: $(basename "$PWD")"
62-
echo "date: $(date +%Y-%m-%d)"
63-
echo "---"
64-
if [ -f README.adoc ]; then cat README.adoc
65-
elif [ -f README.md ]; then cat README.md
66-
else printf '\n# %s\n\nDocumentation coming soon.\n' "$(basename "$PWD")"
67-
fi
68-
} > site/index.md
32+
mkdir -p src
33+
if [ ! -f src/index.md ] && [ -f README.md ]; then
34+
cp README.md src/index.md
35+
elif [ ! -f src/index.md ]; then
36+
echo "# ${GITHUB_REPOSITORY}" > src/index.md
6937
fi
70-
cd .casket-ssg && cabal run casket-ssg -- build ../site ../_site
71-
72-
- name: Setup Pages
73-
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
74-
38+
./.ddraig-ssg/build/exec/ddraig build src _site https://hyperpolymath.github.io/${GITHUB_REPOSITORY#*/}
7539
- name: Upload artifact
76-
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v3
40+
uses: actions/upload-pages-artifact@v3
7741
with:
7842
path: '_site'
79-
8043
deploy:
81-
timeout-minutes: 20
8244
environment:
8345
name: github-pages
8446
url: ${{ steps.deployment.outputs.page_url }}
8547
runs-on: ubuntu-latest
48+
timeout-minutes: 15
8649
needs: build
8750
steps:
8851
- name: Deploy to GitHub Pages
8952
id: deployment
90-
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)