Automate CI/CD with GitHub Actions Templates
Production-ready GitHub Actions patterns for testing, matrix builds, Docker/Kubernetes deployment, and security scanning.
Why it matters
Streamline your development lifecycle by leveraging production-ready GitHub Actions workflow patterns for automated testing, building, and deployment.
Outcomes
What it gets done
Automate testing across multiple Node.js versions.
Build and push Docker images to container registries.
Deploy applications to Kubernetes clusters.
Integrate security scanning and notifications into your CI/CD pipeline.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-github-actions-templates | bash Overview
GitHub Actions Templates
Production-ready GitHub Actions workflow patterns for testing, Docker/Kubernetes deployment, matrix builds, reusable workflows, and security scanning. Use it when automating GitHub-based CI/CD - testing, container builds, Kubernetes deploys, security scans - not for a different CI/CD platform.
What it does
GitHub Actions Templates provides production-ready workflow patterns for continuous integration and deployment across tech stacks: automated testing, Docker image build-and-push to a registry, Kubernetes deployment, matrix builds across multiple language versions or operating systems, reusable workflows callable via workflow_call, security scanning, and approval-gated production deployment with Slack notification. A representative test-workflow pattern runs a Node.js matrix build with linting, tests, and coverage upload:
name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
When to use - and when NOT to
Use this skill when automating testing and deployment, building Docker images and pushing to registries, deploying to Kubernetes clusters, running security scans (the Trivy and Snyk patterns shown scan filesystem and dependency vulnerabilities respectively, uploading SARIF results to GitHub Security), or implementing matrix builds for multiple environments. Ten named best practices: pin specific action versions rather than @latest, cache dependencies, use secrets for sensitive data, implement PR status checks, use matrix builds for multi-version testing, set appropriate permissions, prefer reusable workflows for common patterns, implement approval gates for production, add failure-notification steps, and use self-hosted runners for sensitive workloads. Don't use it for tasks unrelated to GitHub Actions or that need a different CI/CD tool - related skills cover GitLab CI patterns, pipeline architecture, and secrets management specifically.
Inputs and outputs
Input is an application needing CI/CD automation on GitHub; output is a workflow YAML file matching the needed pattern - test, Docker build-and-push, Kubernetes deploy, matrix build, reusable workflow, security scan, or approval-gated production deploy - with reference templates available at assets/test-workflow.yml, assets/deploy-workflow.yml, and assets/matrix-build.yml.
Who it's for
Engineering teams setting up GitHub Actions CI/CD who want proven, production-ready workflow patterns for testing, Docker/Kubernetes deployment, matrix builds, security scanning, and approval gates, rather than writing workflow YAML from scratch. The Docker build-and-push pattern also shows metadata-driven tagging (docker/metadata-action deriving branch, PR, and semver-based tags automatically) and GitHub Actions cache reuse (cache-from/cache-to with type=gha), and the Kubernetes deploy pattern authenticates to AWS, updates the EKS kubeconfig, applies manifests, and verifies rollout status and pod health before finishing.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.