Skip to content

Commit bf47f34

Browse files
committed
Run Hugo in Pull Requests
This commit adds a GitHub workflow that runs in all Pull Requests, to verify that the site builds. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4b51fcc commit bf47f34

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/pr.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Hugo
2+
on: [pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: configure Hugo
10+
run: |
11+
set -x &&
12+
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
13+
- name: install Hugo ${{ env.HUGO_VERSION }}
14+
run: |
15+
set -x &&
16+
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
17+
sudo dpkg -i /tmp/hugo.deb
18+
- name: run Hugo to build the pages
19+
run: hugo
20+
- name: build tar archive
21+
run: cd public && tar czvf ../pages.tar.gz *
22+
- name: Upload build artifact
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: pages
26+
path: pages.tar.gz

0 commit comments

Comments
 (0)