From 10b235a3d7d60d1de186106bc518dce141d6324e Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 18 Nov 2024 22:09:31 +0100 Subject: [PATCH 1/3] hugo.yaml: Limit deployment to manual trigger or pushes to the main branch Signed-off-by: Sebastian Pipping --- .github/workflows/hugo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index d6f1917..2619ec7 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -66,6 +66,7 @@ jobs: # Deployment job deploy: + if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From bc71eacd3b640c1236a5a95bfc1ced848fec1ac3 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 18 Nov 2024 21:55:51 +0100 Subject: [PATCH 2/3] hugo.yaml: Run build for pull requests, too Signed-off-by: Sebastian Pipping --- .github/workflows/hugo.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 2619ec7..5672df2 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -1,6 +1,9 @@ name: Deploy Hugo site to Pages on: + # Runs for pull requests + pull_request: + # Runs on pushes targeting the default branch push: branches: From 99436fc2c59710d070bd23b2786a85531b0735dd Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 18 Nov 2024 21:56:53 +0100 Subject: [PATCH 3/3] hugo.yaml: Stop limiting the push build to the main branch Signed-off-by: Sebastian Pipping --- .github/workflows/hugo.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 5672df2..04f87f3 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -6,8 +6,6 @@ on: # Runs on pushes targeting the default branch push: - branches: - - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: