QA
Intermediate LevelGit & GitHub

How do GitHub Actions workflows automate CI/CD pipelines?

❓ Interview Prompt: Explain GitHub Actions workflow syntax (.github/workflows/*.yml), triggers (on: push, pull_request), jobs, steps, and matrix builds.

GitHub Actions executes automated workflows defined in YAML files inside .github/workflows/. Workflows define triggers (on: push, pull_request), jobs on cloud runners (ubuntu-latest), and sequential steps.

Code Implementation Example

yaml
name: CI
on:
  push:
    branches: [ main ]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test
💡GitHub Actions YAML workflow running automated tests on push and pull requests.
🎯 Interview Key Takeaway

Define automated CI/CD workflows in .github/workflows/*.yml triggered by push and pull_request events.

#GitHub Actions#CI/CD#YAML#Intermediate
Back to all Git & GitHub Questions→

More Git & GitHub Interview Questions

Beginner LevelGit & GitHub

Compare git rebase versus git merge and explain how git bisect finds regressions.

Beginner LevelGit & GitHub

What is the difference between git init and git clone?

Beginner LevelGit & GitHub

What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?