Skip to content

Commit d046f45

Browse files
committed
Always run the build step of the publish workflow, but only deploy on main branch
1 parent 4194949 commit d046f45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Deploy Hugo site to Pages
22

33
on:
44
push:
5-
branches:
6-
- main
75
workflow_dispatch:
86

97
permissions:
@@ -48,10 +46,13 @@ jobs:
4846

4947
- name: Upload artifact
5048
uses: actions/upload-pages-artifact@v3
49+
if: ${{ github.ref == 'refs/heads/main' }}
5150
with:
5251
path: community.hachyderm.io/public/
5352

53+
# Only run deploy on main branch, all others just run the build as a CI step.
5454
deploy:
55+
if: ${{ github.ref == 'refs/heads/main' }}
5556
environment:
5657
name: github-pages
5758
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)