SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

GitHub ActionsCheatsheets

Quick reference — commands, syntax, and patterns

📄
Last updated Jul 2026
Expert Content

GitHub Actions Cheatsheet

yaml
name: CI/CD Pipeline
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
      - run: npm test

  build-push:
    needs: test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - run: docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
      - run: docker push ghcr.io/${{ github.repository }}:${{ github.sha }}

  deploy:
    needs: build-push
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: azure/k8s-deploy@v4
        with:
          namespace: production
          images: ghcr.io/${{ github.repository }}:${{ github.sha }}
          manifests: k8s/deployment.yaml
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
📝
GitHub ActionsNotes
Key takeaways, tips, and important points to remember
Also Worth Exploring
← Back to all GitHub Actions modules
CertificationNotes