Skip to content

Commit 68e58a8

Browse files
committed
Update Hugo GitHub Actions
1 parent 9a77c24 commit 68e58a8

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/hugo.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,51 @@ jobs:
3232
build:
3333
runs-on: ubuntu-latest
3434
env:
35-
HUGO_VERSION: 0.112.7
35+
HUGO_VERSION: 0.145.0
36+
HUGO_ENVIRONMENT: production
37+
TZ: America/Los_Angeles
3638
steps:
3739
- name: Install Hugo CLI
3840
run: |
3941
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
4042
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
41-
- name: Install Dart Sass Embedded
42-
run: sudo snap install dart-sass-embedded
43+
- name: Install Dart Sass
44+
run: sudo snap install dart-sass
4345
- name: Checkout
44-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4547
with:
4648
submodules: recursive
4749
fetch-depth: 0
4850
- name: Setup Pages
4951
id: pages
50-
uses: actions/configure-pages@v3
52+
uses: actions/configure-pages@v5
5153
- name: Install Node.js dependencies
5254
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
55+
- name: Cache Restore
56+
id: cache-restore
57+
uses: actions/cache/restore@v4
58+
with:
59+
path: |
60+
${{ runner.temp }}/hugo_cache
61+
key: hugo-${{ github.run_id }}
62+
restore-keys:
63+
hugo-
5364
- name: Build with Hugo
54-
env:
55-
# For maximum backward compatibility with Hugo modules
56-
HUGO_ENVIRONMENT: production
57-
HUGO_ENV: production
5865
run: |
5966
hugo \
6067
--gc \
6168
--minify \
62-
--baseURL "${{ steps.pages.outputs.base_url }}/"
69+
--baseURL "${{ steps.pages.outputs.base_url }}/" \
70+
--cacheDir "${{ runner.temp }}/hugo_cache"
71+
- name: Cache Save
72+
id: cache-save
73+
uses: actions/cache/save@v4
74+
with:
75+
path: |
76+
${{ runner.temp }}/hugo_cache
77+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
6378
- name: Upload artifact
64-
uses: actions/upload-pages-artifact@v1
79+
uses: actions/upload-pages-artifact@v3
6580
with:
6681
path: ./public
6782

@@ -75,4 +90,4 @@ jobs:
7590
steps:
7691
- name: Deploy to GitHub Pages
7792
id: deployment
78-
uses: actions/deploy-pages@v2
93+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)