Skip to content

Commit 81b1cce

Browse files
committed
ci: add a GitHub workflow to deploy the site
This finishes the transition to a Hugo-backed site. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bf47f34 commit 81b1cce

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/deploy.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy to Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
runs-on: ubuntu-latest
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: configure Hugo
27+
run: |
28+
set -x &&
29+
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
30+
- name: install Hugo ${{ env.HUGO_VERSION }}
31+
run: |
32+
set -x &&
33+
deb=hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
34+
curl -LO https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/$deb &&
35+
sudo dpkg -i $deb
36+
- uses: actions/configure-pages@v5
37+
id: pages
38+
- name: run Hugo to build the pages
39+
env:
40+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
41+
HUGO_ENVIRONMENT: production
42+
HUGO_RELATIVEURLS: false
43+
run: hugo config && hugo --minify --baseURL '${{ steps.pages.outputs.base_url }}/'
44+
- uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: ./public
47+
- uses: actions/deploy-pages@v4
48+
id: deployment

0 commit comments

Comments
 (0)