ci: fix Hugo installation - aggressively remove old versions and use absolute paths
Some checks failed
Checkout test / test (push) Successful in 6s
CI with Native Libraries / Check Build Environment (push) Successful in 10s
CI/CD Pipeline / Test (push) Failing after 5m7s
CI/CD Pipeline / Dev Compose Smoke Test (push) Has been skipped
CI/CD Pipeline / Build (push) Has been skipped
CI/CD Pipeline / Test Scripts (push) Has been skipped
CI/CD Pipeline / Security Scan (push) Failing after 4m52s
Documentation / build-and-publish (push) Failing after 25s
CI with Native Libraries / Build and Test Native Libraries (push) Failing after 16m19s
CI with Native Libraries / Build Release Libraries (push) Has been skipped
CI/CD Pipeline / Docker Build (push) Has been skipped

This commit is contained in:
Jeremie Fraeys 2026-02-12 18:08:25 -05:00
parent 52b20ca7ae
commit 3bd118f2d3
No known key found for this signature in database

View file

@ -47,12 +47,29 @@ jobs:
- name: Install Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
sudo dpkg -i ${{ runner.temp }}/hugo.deb
echo "Target Hugo version: ${HUGO_VERSION}"
# Remove ALL existing Hugo installations aggressively
sudo apt-get remove -y hugo 2>/dev/null || true
sudo rm -f /usr/bin/hugo /usr/local/bin/hugo /usr/local/go/bin/hugo 2>/dev/null || true
sudo rm -rf /usr/local/hugo* 2>/dev/null || true
# Download and install Hugo extended
wget -q -O /tmp/hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i /tmp/hugo.deb || sudo apt-get install -f -y
# Verify the installed version
echo ""
echo "Installed Hugo version:"
/usr/bin/hugo version
# Export PATH to ensure correct Hugo is used
echo "/usr/bin" >> $GITHUB_PATH
- name: Build docs (Forgejo)
run: |
hugo --source docs --gc --minify --baseURL "${FORGEJO_DOCS_BASE_URL}" --destination "${{ runner.temp }}/site-forgejo"
/usr/bin/hugo --source docs --gc --minify --baseURL "${FORGEJO_DOCS_BASE_URL}" --destination "${{ runner.temp }}/site-forgejo"
/usr/bin/hugo version
- name: Build docs (GitHub)
if: env.GH_PAGES_REPO != ''