Any push is deploying my website! #837
-
I'm trying to learn how actions works and this script. I want people to be able to push to their branch and have the branch build to test is and give an error if there is an issue, but I do NOT want a PUSH or a PR to build and deploy my website. The main branch is called "sphinx". Can anyone help me fix the script so that only when a branch is merged from a PR (or I push directly to the sphinx branch) the website is actually published live? Thank you. EDIT: I am wondering if just 2 lines surrounded by asterisks will fix it so that any branch that pushes to github will trigger a build to check for errors, but only a push or PR to sphinx (refs/heads/sphinx) will cause a deploy? Commented out the branches line and added the "if". I don't understand how when the PRs were causing a deploy, the sphinx (what we call the master branch) is not updated, but the code from the pushed branch is what is built and pushed to the live site.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you only want commits on a specific branch to execute the action you need to use the on push event with your main branch. The if statement isn't needed but won't cause the build to fail. https://docs.github.com/en/actions/reference/events-that-trigger-workflows |
Beta Was this translation helpful? Give feedback.
If you only want commits on a specific branch to execute the action you need to use the on push event with your main branch. The if statement isn't needed but won't cause the build to fail.
https://docs.github.com/en/actions/reference/events-that-trigger-workflows