Skip to content

Commit 000522d

Browse files
Copilotrajbos
andcommitted
Modify workflow to always run build, deploy only on main
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent c8e16ea commit 000522d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/deploy-to-pages.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
# Runs on pushes targeting the default branch
4+
# Runs on pushes to any branch to validate build
55
push:
6-
branches: ["main"]
6+
7+
# Runs on pull requests to validate build
8+
pull_request:
79

810
# Allows you to run this workflow manually from the Actions tab
911
workflow_dispatch:
@@ -143,6 +145,8 @@ jobs:
143145

144146
# Deployment job
145147
deploy:
148+
# Only deploy on main branch
149+
if: github.ref == 'refs/heads/main'
146150
environment:
147151
name: github-pages
148152
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)