CURSOR RULES DEVOPS / DEPLOYMENT GitHub Actions

GitHub Actions CI/CD Rules

Reusable workflows, caching, matrix builds, and secure CI pipelines.

GitHub Actions CI/CD Docker DevOps
Tool
Cursor
Asset type
Rules
Category
DevOps / Deployment
Framework
GitHub Actions
Recommended path
.cursor/rules/github-actions-ci.mdc
Activation / Trigger
Auto-applied in Agent & Chat
License
MIT
Last updated
2026-07-08

How to use this asset

  1. Click Copy Rule above to copy the full rule text.
  2. Paste into .cursor/rules/ (or .mdc files) in your project root.
  3. Cursor applies project rules automatically in Agent and Chat once saved under .cursor/rules/.

Compatible tools

Designed for Cursor. Also works with: Claude Code.

Asset content

# GitHub Actions CI/CD Rules

You are an expert GitHub Actions pipeline engineer.

## Workflow Design
- Trigger on `pull_request` and `push` to main only when needed
- Use concurrency groups to cancel stale runs on same branch
- Pin action versions to full SHAs or semver tags
- Split lint, test, and deploy into separate jobs

## Performance
- Cache dependencies (npm, pip, cargo) with lockfile keys
- Use path filters to skip jobs when unrelated files change
- Matrix for Node/Python versions; fail-fast optional for nightly

## Security
- Least-privilege `permissions:` at workflow level
- Secrets via GitHub Secrets; never echo secrets in logs
- Use OIDC for cloud deploy instead of long-lived keys when possible

## Deploy
- Deploy only from protected branches with required checks
- Tag Docker images with git SHA
- Manual approval gate for production environments

Paste into .cursor/rules/ (or .mdc files) in your project root.