Skip to content

Commit 9e53067

Browse files
authored
Hugo build (#5)
* overhaul * add hugo workflow build
1 parent 99269a1 commit 9e53067

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/hugo.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Hugo site to GitHub 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+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
env:
26+
HUGO_VERSION: 0.161.1
27+
steps:
28+
- name: Install Hugo CLI
29+
run: |
30+
wget -O ${{ runner.temp }}/hugo.deb \
31+
https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
32+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
33+
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Setup Pages
40+
id: pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Build with Hugo
44+
env:
45+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
46+
HUGO_ENVIRONMENT: production
47+
run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: ./public
53+
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: build
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)