From b2b9f9a9e7f0d5c2ddbfca58a8f5d34f0ef2ec1d Mon Sep 17 00:00:00 2001 From: Tokyo Momo Date: Sat, 8 Mar 2025 22:38:58 +0400 Subject: [PATCH] Update publish.yaml --- .github/workflows/publish.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f953ce3..61e31d0 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,8 +5,7 @@ env: on: push: - branches: - - main + branches: ["main"] workflow_dispatch: permissions: @@ -20,19 +19,20 @@ concurrency: jobs: build: - if: github.repository_owner != 'HugoBlox' runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Hugo - uses: peaceiris/actions-hugo@v4 + uses: peaceiris/actions-hugo@v2.6.0 with: hugo-version: ${{ env.WC_HUGO_VERSION }} extended: true - - name: Cache Hugo Modules + - name: Cache Hugo modules uses: actions/cache@v4 with: path: /tmp/hugo_cache_runner/ @@ -40,27 +40,27 @@ jobs: restore-keys: | ${{ runner.os }}-hugomod- - - name: Build site + - name: Build with Hugo + env: + HUGO_ENVIRONMENT: production run: | - hugo --minify --baseURL "${{ github.pages_url }}/" + echo "Hugo Cache Dir: $(hugo config | grep cachedir)" + hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/" - name: Generate Pagefind search index run: npx pagefind --site "public" - name: Upload artifact - uses: actions/upload-pages-artifact@v4 + uses: actions/upload-pages-artifact@v3 with: - path: public + path: ./public deploy: environment: name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build - permissions: - pages: write - id-token: write - steps: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4