Skip to content

Commit

Permalink
Always run the build step of the publish workflow, but only deploy on…
Browse files Browse the repository at this point in the history
… main branch
  • Loading branch information
ThisIsMissEm committed Jan 24, 2025
1 parent bf37632 commit 0f301ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Deploy Hugo site to Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 0f301ef

Please sign in to comment.