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→