diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index d6f1917..04f87f3 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -1,10 +1,11 @@ name: Deploy Hugo site to Pages on: + # Runs for pull requests + pull_request: + # Runs on pushes targeting the default branch push: - branches: - - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -66,6 +67,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 }}