0PricingLogin
CI/CD with GitHub Actions & DevOps Pipelines · Lesson

Workflow Triggers and Events

Explore various events that can trigger your GitHub Actions workflows, such as pushes, pull requests, and scheduled events.

What Starts a Workflow?

Workflows in GitHub Actions don't just run by themselves. They need a signal to start! This signal is called a trigger.

Triggers are specific events that tell GitHub Actions, "Hey, something happened! Time to run this workflow." Understanding triggers is key to automating your development process effectively.

The 'on' Keyword

In your workflow file (a .yml file in the .github/workflows directory), you define triggers using the on keyword.

This section tells GitHub Actions when to execute the workflow. You can specify one or many events.

name: My First Triggered Workflow

on:
  push: # This workflow will run on every push event

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Run a simple command
        run: echo "Workflow triggered!"

All lessons in this course

  1. Workflow Triggers and Events
  2. Running Tests with GitHub Actions
  3. Linting and Code Quality Checks
  4. Caching Dependencies for Faster Builds
← Back to CI/CD with GitHub Actions & DevOps Pipelines