From 20f5f247511d013d7338ba628053d2198e3263b7 Mon Sep 17 00:00:00 2001 From: Luca Zeuch Date: Fri, 22 Dec 2023 12:05:21 +0100 Subject: [PATCH] ci: hopefully fix workflow once more Signed-off-by: Luca Zeuch --- .github/workflows/deploy.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bbfe668..2fbe3d0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,8 +4,7 @@ name: Deploy Hugo site to GH Pages on: # Only deploy when it is accepted for production push: - branches: - - master + pull_request: workflow_dispatch: permissions: @@ -35,7 +34,7 @@ jobs: - name: Cache Hugo modules uses: actions/cache@v3 with: - path: /home/runner/.cache/hugo_cache + path: ~/.cache/hugo_cache/ key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-hugomod- @@ -55,6 +54,8 @@ jobs: path: ./public deploy: + # Only deploy if it's actually on main branch + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} needs: build environment: name: github-pages