Skip to content

Commit e9efc3a

Browse files
author
chenyunfei.cs
committed
update github workflow
1 parent 6140cc6 commit e9efc3a

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/hugo.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ name: Deploy Hugo site to Pages
44
on:
55
# Runs on pushes targeting the default branch
66
push:
7-
branches:
8-
- main
7+
branches: ["main"]
98

109
# Allows you to run this workflow manually from the Actions tab
1110
workflow_dispatch:
@@ -32,34 +31,33 @@ jobs:
3231
build:
3332
runs-on: ubuntu-latest
3433
env:
35-
HUGO_VERSION: 0.135.0
34+
HUGO_VERSION: 0.132.2
3635
steps:
37-
- name: Install Hugo CLI
38-
run: |
39-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
40-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
41-
- name: Install Dart Sass
42-
run: sudo snap install dart-sass
4336
- name: Checkout
4437
uses: actions/checkout@v4
4538
with:
39+
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
4640
submodules: recursive
47-
fetch-depth: 0
41+
- name: Setup Go
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version: '1.22'
4845
- name: Setup Pages
4946
id: pages
50-
uses: actions/configure-pages@v5
51-
- name: Install Node.js dependencies
52-
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
47+
uses: actions/configure-pages@v4
48+
- name: Setup Hugo
49+
run: |
50+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
51+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
5352
- name: Build with Hugo
5453
env:
55-
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
54+
# For maximum backward compatibility with Hugo modules
5655
HUGO_ENVIRONMENT: production
57-
TZ: America/Los_Angeles
56+
HUGO_ENV: production
5857
run: |
5958
hugo \
60-
--gc \
61-
--minify \
62-
--baseURL "${{ steps.pages.outputs.base_url }}/"
59+
--gc --minify \
60+
--baseURL "${{ steps.pages.outputs.base_url }}/"
6361
- name: Upload artifact
6462
uses: actions/upload-pages-artifact@v3
6563
with:
@@ -75,4 +73,4 @@ jobs:
7573
steps:
7674
- name: Deploy to GitHub Pages
7775
id: deployment
78-
uses: actions/deploy-pages@v4
76+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)