Skip to content

Commit 25ce7d3

Browse files
committed
fix: make our own setup-hugo composite action as peaceiris/actions-hugo does not support withdeploy yet
1 parent 130e3a6 commit 25ce7d3

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup Hugo
2+
description: Setup Hugo manually while waiting for peaceiris/actions-hugo to support deploy releases
3+
4+
inputs:
5+
hugo-version:
6+
description: 'Version of Hugo to install'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Install and setup Hugo
13+
shell: bash
14+
run: |
15+
base_url="https://github.com/gohugoio/hugo/releases/download"
16+
17+
version="${{ inputs.hugo-version }}"
18+
archive_url="${base_url}/v${version}/hugo_extended_withdeploy_${version}_linux-amd64.tar.gz"
19+
20+
workdir="$HOME/hugo"
21+
bindir="$workdir/bin"
22+
tmpdir="$workdir/tmp"
23+
24+
mkdir -p {"$bindir","$tmpdir"}
25+
26+
curl --fail --location --show-error --silent --output "$tmpdir/hugo.tar.gz" "$archive_url"
27+
tar xvzf "$tmpdir/hugo.tar.gz" -C "$bindir"
28+
rm -r "$tmpdir"
29+
30+
echo "$bindir" >> $GITHUB_PATH

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ jobs:
4242
cache: 'npm'
4343

4444
- name: Setup Hugo
45-
uses: peaceiris/actions-hugo@v3
45+
uses: ./.github/actions/setup-hugo
4646
with:
4747
hugo-version: '0.142.0'
48-
extended: true
4948

5049
- name: Prepare project
5150
run: ./bin/entrypoint.sh prepare

.github/workflows/publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ jobs:
4747
# no cache
4848

4949
- name: Setup Hugo
50-
uses: peaceiris/actions-hugo@v3
50+
uses: ./.github/actions/setup-hugo
5151
with:
5252
hugo-version: '0.142.0'
53-
extended: true
5453

5554
- name: Prepare project
5655
run: ./bin/entrypoint.sh prepare

0 commit comments

Comments
 (0)