Skip to content

Commit 5f2e05c

Browse files
author
Mark Wonsil
committed
Update GitHub Actions Workflow
1 parent 679337b commit 5f2e05c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.github/workflows/pages.yaml

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

910
# Allows you to run this workflow manually from the Actions tab
1011
workflow_dispatch:
@@ -31,33 +32,34 @@ jobs:
3132
build:
3233
runs-on: ubuntu-latest
3334
env:
34-
HUGO_VERSION: 0.124.1
35+
HUGO_VERSION: 0.124.0
3536
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
3643
- name: Checkout
3744
uses: actions/checkout@v4
3845
with:
39-
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
4046
submodules: recursive
41-
- name: Setup Go
42-
uses: actions/setup-go@v5
43-
with:
44-
go-version: '1.22'
47+
fetch-depth: 0
4548
- name: Setup Pages
4649
id: pages
4750
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
51+
- name: Install Node.js dependencies
52+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5253
- name: Build with Hugo
5354
env:
5455
# For maximum backward compatibility with Hugo modules
5556
HUGO_ENVIRONMENT: production
5657
HUGO_ENV: production
5758
run: |
5859
hugo \
59-
--gc --minify \
60-
--baseURL "${{ steps.pages.outputs.base_url }}/"
60+
--gc \
61+
--minify \
62+
--baseURL "${{ steps.pages.outputs.base_url }}/"
6163
- name: Upload artifact
6264
uses: actions/upload-pages-artifact@v3
6365
with:
@@ -73,4 +75,4 @@ jobs:
7375
steps:
7476
- name: Deploy to GitHub Pages
7577
id: deployment
76-
uses: actions/deploy-pages@v4
78+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)