Skip to content

Commit 05040f4

Browse files
committed
Build and publish to github pages
1 parent abf9694 commit 05040f4

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/hugo.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Based on https://raw.githubusercontent.com/qgis/QGIS-Website/refs/heads/main/.github/workflows/github-pages.yml
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
push:
6+
branches: ["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: true
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
env:
26+
HUGO_VERSION: 0.150.0
27+
steps:
28+
- name: Install Hugo CLI
29+
run: |
30+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
31+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
32+
33+
- name: Checkout
34+
uses: actions/checkout@v5
35+
with:
36+
submodules: recursive
37+
38+
- name: Setup Pages
39+
id: pages
40+
uses: actions/configure-pages@v5
41+
42+
- name: Build with Hugo
43+
run: |
44+
hugo \
45+
--config hugo.toml \
46+
--baseURL "${{ steps.pages.outputs.base_url }}/"
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v4
50+
with:
51+
path: ./public
52+
53+
deploy:
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
runs-on: ubuntu-latest
58+
needs: build
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

hugo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ pagination.pagerSize = 1000
3535
identifier = "github"
3636
name = "GitHub"
3737
url = "https://github.com/blinxen"
38+
39+
[caches]
40+
[caches.images]
41+
dir = ':cacheDir/images'

0 commit comments

Comments
 (0)