aregmi.net
Resume

How to add Github workflows

A quick reference for setting up GitHub Actions workflows.

Structure

Workflows live in .github/workflows/ as YAML files. GitHub picks them up automatically.

name: My Workflow

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Hello from GitHub Actions"

Key Concepts

Common Triggers

Trigger When it runs
push Code pushed to a branch
pull_request PR opened, updated, or merged
issues: [labeled] A label is added to an issue
schedule Cron-based (e.g., nightly builds)
workflow_dispatch Manual "Run workflow" button

Permissions

Set fine-grained permissions per job:

permissions:
  contents: write
  issues: write

Tips