Skip to content

Commit 32ee46a

Browse files
committed
try suggested pages.yaml config
1 parent e623f20 commit 32ee46a

File tree

2 files changed

+71
-40
lines changed

2 files changed

+71
-40
lines changed

.github/workflows/hugo.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/pages.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy Hugo site to Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
# Default to bash
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
fetch-depth: 0
35+
36+
- name: Setup Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: '1.23'
40+
41+
- name: Setup Hugo
42+
uses: peaceiris/actions-hugo@v3
43+
with:
44+
hugo-version: "latest"
45+
extended: true
46+
47+
- name: Build
48+
env:
49+
# For maximum backward compatibility with Hugo modules
50+
HUGO_ENVIRONMENT: production
51+
HUGO_ENV: production
52+
run: |
53+
hugo \
54+
--gc --minify \
55+
--baseURL "${{ steps.pages.outputs.base_url }}/"
56+
57+
- name: Upload artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: ./public
61+
62+
deploy:
63+
runs-on: ubuntu-latest
64+
needs: build
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)