Running GitHub Actions CI/CD triggers on specific branches

GitHub Actions allows you to automate, customize and execute your software development workflows inside your repository. https://dev.to/github/running-github-actions-ci-cd-triggers-on-specific-branches-5e6m You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs. The most common events are push and pull_request events to trigger workflow runs on any change to the main branch. The workflow will run for any pull request opened and show your workflows directly in the pull request. You want certain events to run on specific branches. You adjust the YAML to include branch names to only run CI checks on branches you needed them. Below I have changed my events to run on the main branch, even though it is named the push. It will run when you run git push or merge a pull request into the main branch. on: push: branches: - main pull_request: branches: - main Finally, you can leverage YAML syntax to run an array of branches. You can also set up wildcards to run on similarly named branches as well. So now you can set up a workflow to run in multiple branches and maintain separate release tracks. Join my live coding stream every Tuesday and Fridays on Twitch Twitch 🎬 https://twitch.tv/bdougieYO GitHub 💻. https://github.com/bdougie/gitActionTraction Community 👾 https://discord.com/invite/gZMKK5q Twitter 🐦 https://twitter.com/bdougieYO https://dev.to/github/running-github-actions-ci-cd-triggers-on-specific-branches-5e6m


Published: Feb 25, 2021

View my video on YouTube