GitHub Actions CI/CD Guide
Ad
What is GitHub Actions?
GitHub Actions automates workflows — running tests, builds, and deployments automatically when you push code. It's GitHub's built-in CI/CD.
A Basic Workflow
# .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm test
Key Concepts
| Term | Meaning |
|---|---|
| Workflow | The automation file |
| Trigger (on) | What starts it |
| Job | A set of steps |
| Step | A single task |
| Action | Reusable step |
Auto-Deploy Example
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run build
- run: npm run deploy
FAQs
Is GitHub Actions free?
Free minutes for public repos and a monthly allowance for private. More in our GitHub guides.
What is CI/CD?
Continuous Integration (auto-test) and Continuous Deployment (auto-release). See our DevOps guides.
