Member-only story
GitOps — Github Actions Workflow Common Triggers
Webhooks, in general, are HTTP callbacks that can be defined by a user and are triggered by specific events that happen on a platform. In GitHub Actions, there are many different webhook events that you can consider when implementing CI/CD strategies using GitHub Actions.
Those events can be used individually and in conjunction with manual and scheduled events. In this arcile I will introduce some commonly used webhook triggers.
Branch/Tag creation
This event triggers a workflow any time a branch or tag is created. This is useful in scenarios where a new release is created and you want to be notified when this workflow starts and finishes running. For example:
name: My Workflow
on:
create:
branches:
- '*'
tags:
- '*'
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# Add your build, test, and deployment steps here
- name: Run build and tests
run: |
echo "Add your build and test commands here"
Now create a new branch and push it up to Github repo, you will see a workflow run: