updated CI to use GitHub's API
All checks were successful
Build website to check for errors / test (push) Successful in 14s
Deploy website on production server on a tag / test (push) Successful in 12s

This commit is contained in:
2026-07-30 05:30:49 +02:00
parent eaca350067
commit a69b0c2c93
2 changed files with 22 additions and 8 deletions

View File

@@ -17,10 +17,17 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: | - name: Install latest Hugo
export HUGO_VERSION=$(curl --silent -I https://github.com/gohugoio/hugo/releases/latest | grep location | sed 's|.*tag/||' | tr -d '\r') run: |
export HUGO_VERSION_SHORT=$(echo ${HUGO_VERSION} | sed 's/v//') set -euo pipefail
wget https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_${HUGO_VERSION_SHORT}_linux-amd64.deb tag="$(curl --silent --show-error --location --fail-with-body \
-H 'Accept: application/vnd.github+json' \
https://api.github.com/repos/gohugoio/hugo/releases/latest \
| jq -r '.tag_name // empty')"
[ -n "$tag" ] || { echo "no tag_name in gohugoio/hugo releases/latest" >&2; exit 1; }
export HUGO_VERSION="$tag"
export HUGO_VERSION_SHORT="${HUGO_VERSION#v}"
wget "https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_${HUGO_VERSION_SHORT}_linux-amd64.deb"
dpkg -i hugo_*.deb dpkg -i hugo_*.deb
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

View File

@@ -17,10 +17,17 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: | - name: Install latest Hugo
export HUGO_VERSION=$(curl --silent -I https://github.com/gohugoio/hugo/releases/latest | grep location | sed 's|.*tag/||' | tr -d '\r') run: |
export HUGO_VERSION_SHORT=$(echo ${HUGO_VERSION} | sed 's/v//') set -euo pipefail
wget https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_${HUGO_VERSION_SHORT}_linux-amd64.deb tag="$(curl --silent --show-error --location --fail-with-body \
-H 'Accept: application/vnd.github+json' \
https://api.github.com/repos/gohugoio/hugo/releases/latest \
| jq -r '.tag_name // empty')"
[ -n "$tag" ] || { echo "no tag_name in gohugoio/hugo releases/latest" >&2; exit 1; }
export HUGO_VERSION="$tag"
export HUGO_VERSION_SHORT="${HUGO_VERSION#v}"
wget "https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_${HUGO_VERSION_SHORT}_linux-amd64.deb"
dpkg -i hugo_*.deb dpkg -i hugo_*.deb
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with: