Skip to content

Commit 390c989

Browse files
committed
ci: add GitHub Pages demo site deployment workflow
1 parent ecec5b9 commit 390c989

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/demo.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Demo
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
name: Build demo site
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
- name: Install Hugo
27+
uses: peaceiris/actions-hugo@v3
28+
with:
29+
hugo-version: "0.145.0"
30+
extended: true
31+
- name: Build rulebound
32+
run: go build -o rulebound .
33+
- name: Create Pages config
34+
run: |
35+
cp examples/starter-package/rulebound.yml /tmp/rulebound-demo.yml
36+
sed -i 's|baseURL: /|baseURL: /rulebound/|' /tmp/rulebound-demo.yml
37+
- name: Generate demo site
38+
run: ./rulebound build examples/starter-package --output ./demo-output --config /tmp/rulebound-demo.yml
39+
- name: Upload Pages artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: ./demo-output
43+
44+
deploy:
45+
name: Deploy to GitHub Pages
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)