From 0f301ef1e839afab233135dfd29a85e499b40597 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Fri, 24 Jan 2025 15:08:13 +0100 Subject: [PATCH] Always run the build step of the publish workflow, but only deploy on main branch --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8aeb3af5..45094f68 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,6 @@ name: Deploy Hugo site to Pages on: push: - branches: - - main workflow_dispatch: permissions: @@ -45,10 +43,13 @@ jobs: run: make -C community.hachyderm.io hugo - name: Upload artifact uses: actions/upload-pages-artifact@v3 + if: ${{ github.ref == 'refs/heads/main' }} with: path: community.hachyderm.io/public/ + # Only run deploy on main branch, all others just run the build as a CI step. deploy: + if: ${{ github.ref == 'refs/heads/main' }} environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}