alt method of grabbing hugo
Some checks failed
Hugo / build (push) Failing after 13s

This commit is contained in:
brookee 2024-02-29 19:57:10 -05:00
parent 9378dc1f03
commit 09db82339b

View file

@ -17,11 +17,17 @@ jobs:
run: | run: |
apt-get update && \ apt-get update && \
apt-get install -y jq rsync tar wget && \ apt-get install -y jq rsync tar wget && \
wget https://github.com/gohugoio/hugo/releases/download/v0.123.4/hugo_0.123.4_linux-amd64.tar.gz && \
tar -xzvf hugo_0.123.4_linux-amd64.tar.gz && \
chmod +x hugo chmod +x hugo
- name: Run build task - name: Get latest Hugo version
run: ./hugo --minify --logLevel info run: |
url=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")) | .browser_download_url' | grep -E 'hugo_[0-9]+\.[0-9]+\.[0-9]+_linux-amd64.tar.gz')
wget -P /tmp/hugo/ "$url"
version=$(echo "$url" | grep -oP 'hugo_\K[0-9]+\.[0-9]+\.[0-9]+')
echo "Downloaded Hugo version: $version"
- name: Unpack Hugo
run: tar -xf /tmp/hugo/* -C ${{ gitea.workspace }}/bin
- name: Build the static webpage
run: ${{ gitea.workspace }}/bin/hugo --minify
- name: Test static page - name: Test static page
run: bash ${{ gitea.workspace }}/bin/test_static_page.sh run: bash ${{ gitea.workspace }}/bin/test_static_page.sh
- name: Deploy to Server - name: Deploy to Server