Skip to content

Commit d59181c

Browse files
committed
ci: mass-deploy Ddraig SSG workflow
1 parent 85e88f3 commit d59181c

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: GitHub Pages (Ddraig SSG)
2+
on:
3+
push:
4+
branches: [main, master]
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: false
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
container:
18+
image: ghcr.io/stefan-hoeck/idris2-pack@sha256:f0758996a931fb35d9ecb1de273c4d59dabe2a09b433afc7e357f65a08b7e1ff
19+
steps:
20+
- name: Checkout Site
21+
uses: actions/checkout@v4
22+
- name: Checkout Ddraig SSG
23+
uses: actions/checkout@v4
24+
with:
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
30+
- name: Build site
31+
run: |
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
37+
fi
38+
./.ddraig-ssg/build/exec/ddraig build src _site https://hyperpolymath.github.io/${GITHUB_REPOSITORY#*/}
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: '_site'
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 15
49+
needs: build
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)