Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Actions branch depended #24

Open
marckoch opened this issue Feb 25, 2022 · 2 comments
Open

make Actions branch depended #24

marckoch opened this issue Feb 25, 2022 · 2 comments
Labels
github_actions Pull requests that update Github_actions code

Comments

@marckoch
Copy link
Owner

now the CI/CD pipeline also triggers a deploy when running in a branch. this should only occur in main branch.

@marckoch marckoch added the github_actions Pull requests that update Github_actions code label Feb 25, 2022
@ahmadjubair33
Copy link

Hi @marckoch GitHub action is applied only on default branch .So make main branch as default only.

@marckoch
Copy link
Owner Author

Hello @ahmadjubair33 , thanks for your comment.

But main is and always was the default branch.

see here: the build on the PR branch marckoch-patch-1 did all three build stages, pushed its image to AWS ECR and triggered a redeploy on the AWS Beanstalk env. This i do not want! This should only happen after the merge of the patch branch to main branch.

So I want this:

  • build on main branch -> do all three stages and deploy to AWS
  • build on any other branch -> only do first stage (build and test), NO deployment to AWS

I assume I have to add something like if: github.ref == 'refs/heads/main' to the deployment steps that should only happen when main is build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update Github_actions code
Projects
None yet
Development

No branches or pull requests

2 participants