A curated collection of production-ready GitHub Actions workflow templates for DevOps automation — security scanning, Docker CI/CD, database migrations, static site deployments, and more.
This repository provides reusable, drop-in GitHub Actions workflow templates designed for real-world DevOps pipelines. Each template is thoroughly commented, follows CI/CD best practices, and is ready to be adapted with minimal configuration.
Templates cover four domains:
- 🔒 Security — secrets scanning, dependency vulnerabilities, license compliance
- 🐳 Containers — Docker image build and push
- 🗄️ Database — schema migration automation
- 🚀 Deployment — static site publishing
- 🧹 Maintenance — stale issue management
| Template | File | Trigger | Description |
|---|---|---|---|
| 🔐 Secrets Scanner | secrets-scanner.yml |
Push, PR | Scans codebase for accidentally committed secrets, tokens, and credentials |
| 🛡️ Dependency Vulnerability Checker | dependency-vulnerability-checker.yml |
Push, PR, Schedule | Audits project dependencies for known CVEs and security advisories |
| 📜 License Compliance Checker | license-compliance-checker.yml |
Push, PR | Validates open-source license compatibility across dependencies |
| 🐳 Docker Build & Push | docker-build-push.yml |
Push, Release | Builds Docker images and pushes to a container registry (GHCR/DockerHub) |
| 🗄️ DB Schema Migrator | db-schema-migrator.yml |
Push, Manual | Runs database schema migrations in a controlled, environment-aware pipeline |
| 🌐 Static Site Deployment | static-site-deployment.yml |
Push | Builds and deploys static sites to hosting platforms (GitHub Pages, S3, etc.) |
| 🧹 Stale Issue Closer | stale-issue-closer.yml |
Schedule | Automatically labels and closes inactive issues and pull requests |
# Clone this repo
git clone https://github.com/donny-devops/github-actions-templates.git
# Copy the desired template into your project
cp github-actions-templates/templates/docker-build-push.yml \
your-project/.github/workflows/docker-build-push.ymlEach template lists the required secrets in its header comments. Add them via:
Settings → Secrets and variables → Actions → New repository secret
Open the copied .yml file, update the environment variables and configuration blocks marked with # TODO: comments, then commit and push.
File: templates/secrets-scanner.yml
Detects accidentally committed secrets (API keys, tokens, passwords) before they reach production. Integrates with tools like trufflesecurity/trufflehog or gitleaks.
# Required secrets: none
# Recommended: configure .gitleaks.toml or trufflehog config for allowlistsFile: templates/dependency-vulnerability-checker.yml
Scans requirements.txt, package.json, go.sum, and other manifest files for known CVEs. Supports Python (Safety/pip-audit), Node.js (npm audit), and more.
# Triggers: push, pull_request, scheduled weekly
# Configurable: severity threshold (low/medium/high/critical)File: templates/license-compliance-checker.yml
Ensures all dependencies use approved open-source licenses. Blocks GPL/AGPL licenses from entering commercial codebases if configured.
# Configurable: allowed license list, fail-on-violation flagFile: templates/docker-build-push.yml
Builds a Docker image with layer caching, tags it with the commit SHA and branch, and pushes to GitHub Container Registry (GHCR) or Docker Hub.
# Required secrets:
# REGISTRY_USERNAME - Container registry username
# REGISTRY_PASSWORD - Container registry token/password
# Features: BuildKit cache, multi-platform support, image signingFile: templates/db-schema-migrator.yml
Runs schema migrations (Flyway, Liquibase, Alembic, or raw SQL) against a target database. Supports environment-based promotion (dev → staging → prod).
# Required secrets:
# DB_HOST - Database host
# DB_PORT - Database port
# DB_NAME - Database name
# DB_USER - Database username
# DB_PASSWORD - Database passwordFile: templates/static-site-deployment.yml
Builds a static site (React, Vue, Hugo, Jekyll, plain HTML) and deploys to GitHub Pages, AWS S3, or Netlify. Includes build caching and deployment previews for PRs.
# Configurable: build_command, output_dir, deploy_target
# Optional secrets: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY (for S3)File: templates/stale-issue-closer.yml
Automatically labels issues and PRs as stale after a configurable period of inactivity, then closes them if no response is received.
# Runs: daily via cron schedule
# Configurable: stale-after days, close-after days, exempt labelsgithub-actions-templates/
├── README.md
├── .gitignore
└── templates/
├── secrets-scanner.yml
├── dependency-vulnerability-checker.yml
├── license-compliance-checker.yml
├── docker-build-push.yml
├── db-schema-migrator.yml
├── static-site-deployment.yml
└── stale-issue-closer.yml
Contributions are welcome! To add a new template:
- Fork this repository
- Create a branch:
git checkout -b feat/my-new-template - Add your template to
templates/with inline comments explaining each block - Update the template catalog table in this README
- Open a pull request
Template standards:
- Include a header block describing the template's purpose, triggers, and required secrets
- Mark all user-configurable values with
# TODO:comments - Use environment variables instead of hardcoded values
- Follow the principle of least privilege for
permissions:blocks
MIT © donny-devops
Built with ❤️ for DevOps engineers who automate everything that should never be manual.