Skills · Infrastructure & ops

Github Actions Templates

Unverified30/40

Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.

Originally by wshobson · MIT

Claude CodePartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
CursorPartialPlain prose you can paste in — but no Cursor rules file
CodexPartialPlain prose you can paste in — but no AGENTS.md
Gemini CLIPartialPlain prose you can paste in
CopilotPartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add github-actions-templates

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.

The whole source

No sign-in, no blur, nothing truncated
github-actions-templates/SKILL.md329 lines7.0 KBRawView on GitHub
Frontmatter — 2 properties
namegithub-actions-templates
descriptionCreate production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
1---
2name: github-actions-templates
3description: Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
4---A5No allowed-tools declared — no way to tell what this skill may touch
5 
6# GitHub Actions Templates
7 
8Production-ready GitHub Actions workflow patterns for testing, building, and deploying applications.
9 
10## Purpose
11 
12Create efficient, secure GitHub Actions workflows for continuous integration and deployment across various tech stacks.
13 
14## When to Use
15 
16- Automate testing and deployment
17- Build Docker images and push to registries
18- Deploy to Kubernetes clusters
19- Run security scans
20- Implement matrix builds for multiple environments
21 
22## Common Workflow Patterns
23 
24### Pattern 1: Test Workflow
25 
26```yaml
27name: Test
28 
29on:
30 push:
31 branches: [main, develop]
32 pull_request:
33 branches: [main]
34 
35jobs:
36 test:
37 runs-on: ubuntu-latest
38 
39 strategy:
40 matrix:
41 node-version: [18.x, 20.x]
42 
43 steps:
44 - uses: actions/checkout@v4
45 
46 - name: Use Node.js ${{ matrix.node-version }}
47 uses: actions/setup-node@v4
48 with:
49 node-version: ${{ matrix.node-version }}
50 cache: "npm"
51 
52 - name: Install dependencies
53 run: npm ci
54 
55 - name: Run linter
56 run: npm run lint
57 
58 - name: Run tests
59 run: npm test
60 
61 - name: Upload coverage
62 uses: codecov/codecov-action@v4
63 with:
64 files: ./coverage/lcov.info
65```
66 
67**Reference:** See `assets/test-workflow.yml`
68 
69### Pattern 2: Build and Push Docker Image
70 
71```yaml
72name: Build and Push
73 
74on:
75 push:
76 branches: [main]
77 tags: ["v*"]
78 
79env:
80 REGISTRY: ghcr.io
81 IMAGE_NAME: ${{ github.repository }}
82 
83jobs:
84 build:
85 runs-on: ubuntu-latest
86 permissions:
87 contents: read
88 packages: write
89 
90 steps:
91 - uses: actions/checkout@v4
92 
93 - name: Log in to Container Registry
94 uses: docker/login-action@v3
95 with:
96 registry: ${{ env.REGISTRY }}
97 username: ${{ github.actor }}
98 password: ${{ secrets.GITHUB_TOKEN }}
99 
100 - name: Extract metadata
101 id: meta
102 uses: docker/metadata-action@v5
103 with:
104 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
105 tags: |
106 type=ref,event=branch
107 type=ref,event=pr
108 type=semver,pattern={{version}}
109 type=semver,pattern={{major}}.{{minor}}
110 
111 - name: Build and push
112 uses: docker/build-push-action@v5
113 with:
114 context: .
115 push: true
116 tags: ${{ steps.meta.outputs.tags }}
117 labels: ${{ steps.meta.outputs.labels }}
118 cache-from: type=gha
119 cache-to: type=gha,mode=max
120```
121 
122**Reference:** See `assets/deploy-workflow.yml`
123 
124### Pattern 3: Deploy to Kubernetes
125 
126```yaml
127name: Deploy to Kubernetes
128 
129on:
130 push:
131 branches: [main]
132 
133jobs:
134 deploy:
135 runs-on: ubuntu-latest
136 
137 steps:
138 - uses: actions/checkout@v4
139 
140 - name: Configure AWS credentials
141 uses: aws-actions/configure-aws-credentials@v4
142 with:
143 aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
144 aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
145 aws-region: us-west-2
146 
147 - name: Update kubeconfig
148 run: |
149 aws eks update-kubeconfig --name production-cluster --region us-west-2
150 
151 - name: Deploy to Kubernetes
152 run: |
153 kubectl apply -f k8s/
154 kubectl rollout status deployment/my-app -n production
155 kubectl get services -n production
156 
157 - name: Verify deployment
158 run: |
159 kubectl get pods -n production
160 kubectl describe deployment my-app -n production
161```
162 
163### Pattern 4: Matrix Build
164 
165```yaml
166name: Matrix Build
167 
168on: [push, pull_request]
169 
170jobs:
171 build:
172 runs-on: ${{ matrix.os }}
173 
174 strategy:
175 matrix:
176 os: [ubuntu-latest, macos-latest, windows-latest]
177 python-version: ["3.9", "3.10", "3.11", "3.12"]
178 
179 steps:
180 - uses: actions/checkout@v4
181 
182 - name: Set up Python
183 uses: actions/setup-python@v5
184 with:
185 python-version: ${{ matrix.python-version }}
186 
187 - name: Install dependencies
188 run: |
189 python -m pip install --upgrade pip
190 pip install -r requirements.txt
191 
192 - name: Run tests
193 run: pytest
194```
195 
196**Reference:** See `assets/matrix-build.yml`
197 
198## Workflow Best Practices
199 
2001. **Use specific action versions** (@v4, not @latest)
2012. **Cache dependencies** to speed up builds
2023. **Use secrets** for sensitive data
2034. **Implement status checks** on PRs
2045. **Use matrix builds** for multi-version testing
2056. **Set appropriate permissions**
2067. **Use reusable workflows** for common patterns
2078. **Implement approval gates** for production
2089. **Add notification steps** for failures
20910. **Use self-hosted runners** for sensitive workloads
210 
211## Reusable Workflows
212 
213```yaml
214# .github/workflows/reusable-test.yml
215name: Reusable Test Workflow
216 
217on:
218 workflow_call:
219 inputs:
220 node-version:
221 required: true
222 type: string
223 secrets:
224 NPM_TOKEN:
225 required: true
226 
227jobs:
228 test:
229 runs-on: ubuntu-latest
230 steps:
231 - uses: actions/checkout@v4
232 - uses: actions/setup-node@v4
233 with:
234 node-version: ${{ inputs.node-version }}
235 - run: npm ci
236 - run: npm test
237```
238 
239**Use reusable workflow:**
240 
241```yaml
242jobs:
243 call-test:
244 uses: ./.github/workflows/reusable-test.yml
245 with:
246 node-version: "20.x"
247 secrets:
248 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
249```
250 
251## Security Scanning
252 
253```yaml
254name: Security Scan
255 
256on:
257 push:
258 branches: [main]
259 pull_request:
260 branches: [main]
261 
262jobs:
263 security:
264 runs-on: ubuntu-latest
265 
266 steps:
267 - uses: actions/checkout@v4
268 
269 - name: Run Trivy vulnerability scanner
270 uses: aquasecurity/[email protected]
271 with:
272 scan-type: "fs"
273 scan-ref: "."
274 format: "sarif"
275 output: "trivy-results.sarif"
276 
277 - name: Upload Trivy results to GitHub Security
278 uses: github/codeql-action/upload-sarif@v3
279 with:
280 sarif_file: "trivy-results.sarif"
281 
282 - name: Run Snyk Security Scan
283 uses: snyk/actions/[email protected]
284 env:
285 SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
286```
287 
288## Deployment with Approvals
289 
290```yaml
291name: Deploy to Production
292 
293on:
294 push:
295 tags: ["v*"]
296 
297jobs:
298 deploy:
299 runs-on: ubuntu-latest
300 environment:
301 name: production
302 url: https://app.example.com
303 
304 steps:
305 - uses: actions/checkout@v4
306 
307 - name: Deploy application
308 run: |
309 echo "Deploying to production..."
310 # Deployment commands here
311 
312 - name: Notify Slack
313 if: success()
314 uses: slackapi/slack-github-action@v1
315 with:
316 webhook-url: ${{ secrets.SLACK_WEBHOOK }}
317 payload: |
318 {
319 "text": "Deployment to production completed successfully!"
320 }
321```
322 
323 
324## Related Skills
325 
326- `gitlab-ci-patterns` - For GitLab CI workflows
327- `deployment-pipeline-design` - For pipeline architecture
328- `secrets-management` - For secrets handling
329 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Infrastructure & ops