Skip to content

Commit d0a9cbc

Browse files
committed
FIX: jekyll build error
1 parent dcfe57e commit d0a9cbc

File tree

2 files changed

+71
-37
lines changed

2 files changed

+71
-37
lines changed

.github/workflows/hugo.yaml

Lines changed: 71 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,103 @@
1-
name: Deploy Hugo PaperMod Demo to Pages
2-
1+
name: Build and deploy
32
on:
43
push:
5-
paths-ignore:
6-
- "images/**"
7-
- "LICENSE"
8-
- "README.md"
94
branches:
105
- main
116
workflow_dispatch:
12-
# manual run
13-
inputs:
14-
hugoVersion:
15-
description: "Hugo Version"
16-
required: false
17-
default: "0.150.0"
18-
19-
# Allow one concurrent deployment
20-
concurrency:
21-
group: "pages"
22-
cancel-in-progress: true
23-
24-
# Default to bash
25-
defaults:
26-
run:
27-
shell: bash
28-
29-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
307
permissions:
318
contents: read
329
pages: write
3310
id-token: write
34-
11+
concurrency:
12+
group: pages
13+
cancel-in-progress: false
14+
defaults:
15+
run:
16+
shell: bash
3517
jobs:
36-
# Build job
3718
build:
3819
runs-on: ubuntu-latest
3920
env:
40-
HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.150.0' }}
21+
DART_SASS_VERSION: 1.92.1
22+
GO_VERSION: 1.25.1
23+
HUGO_VERSION: 0.150.0
24+
NODE_VERSION: 22.18.0
25+
TZ: Europe/Oslo
4126
steps:
42-
- name: Install Hugo CLI
43-
run: |
44-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \
45-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
4627
- name: Checkout
47-
uses: actions/checkout@v4
28+
uses: actions/checkout@v5
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
- name: Setup Go
33+
uses: actions/setup-go@v5
4834
with:
49-
ref: exampleSite
35+
go-version: ${{ env.GO_VERSION }}
36+
cache: false
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: ${{ env.NODE_VERSION }}
5041
- name: Setup Pages
5142
id: pages
5243
uses: actions/configure-pages@v5
44+
- name: Create directory for user-specific executable files
45+
run: |
46+
mkdir -p "${HOME}/.local"
47+
- name: Install Dart Sass
48+
run: |
49+
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
50+
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
51+
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
52+
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
53+
- name: Install Hugo
54+
run: |
55+
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
56+
mkdir "${HOME}/.local/hugo"
57+
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
58+
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
59+
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
60+
- name: Verify installations
61+
run: |
62+
echo "Dart Sass: $(sass --version)"
63+
echo "Go: $(go version)"
64+
echo "Hugo: $(hugo version)"
65+
echo "Node.js: $(node --version)"
66+
- name: Install Node.js dependencies
67+
run: |
68+
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
69+
- name: Configure Git
70+
run: |
71+
git config core.quotepath false
5372
- name: Get Theme
5473
run: git submodule update --init --recursive
5574
- name: Update theme to Latest commit
5675
run: git submodule update --remote --merge
57-
- name: Build with Hugo
76+
- name: Cache restore
77+
id: cache-restore
78+
uses: actions/cache/restore@v4
79+
with:
80+
path: ${{ runner.temp }}/hugo_cache
81+
key: hugo-${{ github.run_id }}
82+
restore-keys:
83+
hugo-
84+
- name: Build the site
5885
run: |
5986
hugo \
60-
--buildDrafts --gc \
61-
--baseURL ${{ steps.pages.outputs.base_url }}
87+
--gc \
88+
--minify \
89+
--baseURL "${{ steps.pages.outputs.base_url }}/" \
90+
--cacheDir "${{ runner.temp }}/hugo_cache"
91+
- name: Cache save
92+
id: cache-save
93+
uses: actions/cache/save@v4
94+
with:
95+
path: ${{ runner.temp }}/hugo_cache
96+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
6297
- name: Upload artifact
6398
uses: actions/upload-pages-artifact@v3
6499
with:
65100
path: ./public
66-
# Deployment job
67101
deploy:
68102
environment:
69103
name: github-pages

.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)