ci: fix Hugo install to match runner arch (arm64/amd64 auto-detect)
Build & Deploy Brands / build-and-deploy (push) Waiting to run
Build & Deploy Brands / build-and-deploy (push) Waiting to run
This commit is contained in:
@@ -76,10 +76,17 @@ jobs:
|
|||||||
- name: Install Hugo Extended
|
- name: Install Hugo Extended
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
HUGO_TARBALL="hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
|
# Pick the tarball matching the runner CPU architecture (the runner
|
||||||
|
# image may be arm64, not amd64 — a mismatch gives "Exec format error").
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64|amd64) HUGO_ARCH="linux-amd64" ;;
|
||||||
|
aarch64|arm64) HUGO_ARCH="linux-arm64" ;;
|
||||||
|
*) echo "unsupported arch: $(uname -m)"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
HUGO_TARBALL="hugo_extended_${HUGO_VERSION}_${HUGO_ARCH}.tar.gz"
|
||||||
URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_TARBALL}"
|
URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_TARBALL}"
|
||||||
echo "Downloading $URL"
|
echo "Runner arch $(uname -m) -> downloading $URL"
|
||||||
curl -sSL --retry 3 -o /tmp/hugo.tar.gz "$URL"
|
curl -fsSL --retry 3 -o /tmp/hugo.tar.gz "$URL"
|
||||||
mkdir -p "$(dirname "$HUGO_BIN")"
|
mkdir -p "$(dirname "$HUGO_BIN")"
|
||||||
tar -xzf /tmp/hugo.tar.gz -C "$(dirname "$HUGO_BIN")" hugo
|
tar -xzf /tmp/hugo.tar.gz -C "$(dirname "$HUGO_BIN")" hugo
|
||||||
"$HUGO_BIN" version
|
"$HUGO_BIN" version
|
||||||
|
|||||||
Reference in New Issue
Block a user