From 86b5c69f389909a9c66962297869038fb546ac26 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 9 May 2026 22:20:25 +0530 Subject: [PATCH] ci(gh-pages): update Hugo version to latest and improve version resolution --- .github/workflows/gh-pages.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c36e6cef..7f84d940 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,7 @@ on: hugoVersion: description: "Hugo Version" required: false - default: "0.146.0" + default: "latest" # Allow one concurrent deployment concurrency: @@ -34,19 +34,25 @@ jobs: contents: read runs-on: ubuntu-latest env: - HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.146.0' }} + HUGO_VERSION: ${{ github.event.inputs.hugoVersion || 'latest' }} steps: + - name: Resolve Hugo version + run: | + if [ "${HUGO_VERSION}" = "latest" ]; then + HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/') + echo "HUGO_VERSION=${HUGO_VERSION}" >> $GITHUB_ENV + fi - name: Install Hugo CLI run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: exampleSite - name: Setup Pages id: pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@v6 - name: Get Theme run: git submodule update --init --recursive - name: Update theme to Latest commit @@ -57,7 +63,7 @@ jobs: --buildDrafts --gc \ --baseURL ${{ steps.pages.outputs.base_url }} - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: ./public # Deployment job @@ -73,4 +79,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5