Automate CI/CD pipelines with GitHub Actions. Master workflow syntax, event triggers, jobs, steps, environment variables, secrets, artifacts, matrix builds, and deployment patterns. Use when setting up automated testing, building, and deployment workflows.
Generates GitHub Actions workflows for automated testing, building, and deployment pipelines.
npx claudepluginhub karchtho/my-claude-marketplaceThis skill is limited to using the following tools:
Build robust CI/CD pipelines with GitHub Actions for automated testing, building, and deployment.
GitHub Actions workflows are YAML files in .github/workflows/ directory.
# .github/workflows/test.yml
name: Tests
# Trigger conditions
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
# Jobs
jobs:
test:
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@v4
# Setup Node.js
- uses: actions/setup-node@v4
with:
node-version: '20'
# Install dependencies
- run: npm ci
# Run tests
- run: npm test
on:
push:
branches:
- main
- develop
paths:
- 'src/**'
- 'package.json'
tags:
- 'v*'
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
# Run weekly on Monday at 9 AM UTC
- cron: '0 9 * * MON'
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: true
type: choice
options:
- staging
- production
version:
description: 'Version to deploy'
required: true
on:
release:
types:
- created
- published
- edited
jobs:
test:
runs-on: ubuntu-latest
name: Run Tests
steps:
- uses: actions/checkout@v4
- run: npm test
jobs:
test:
runs-on: ubuntu-latest
env:
NODE_ENV: test
LOG_LEVEL: debug
steps:
- uses: actions/checkout@v4
- run: npm test
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run lint
test:
runs-on: ubuntu-latest
needs: lint # Wait for lint to complete
steps:
- uses: actions/checkout@v4
- run: npm test
build:
runs-on: ubuntu-latest
needs: test # Wait for test to complete
steps:
- uses: actions/checkout@v4
- run: npm run build
| Runner | OS | Specs |
|---|---|---|
ubuntu-latest | Ubuntu 22.04 | 2 vCPU, 7 GB RAM |
ubuntu-20.04 | Ubuntu 20.04 | 2 vCPU, 7 GB RAM |
windows-latest | Windows Server 2022 | 2 vCPU, 7 GB RAM |
macos-latest | macOS 12.x | 3 vCPU, 14 GB RAM |
jobs:
deploy:
runs-on: [self-hosted, linux, x64]
steps:
# Default shell (bash on Linux/Mac, PowerShell on Windows)
- run: npm test
# Specific shell
- shell: bash
run: npm test
# Multi-line commands
- run: |
npm run lint
npm run test
npm run build
steps:
# Official actions
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
# Community actions
- uses: docker/setup-qemu-action@v3
- uses: docker/build-push-action@v5
steps:
- uses: actions/checkout@v4
- run: npm test
if: github.event_name == 'pull_request'
- run: npm run deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
- run: echo "PR from fork"
if: github.event.pull_request.head.repo.full_name != github.repository
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- run: deploy.sh
env:
API_KEY: ${{ secrets.PROD_API_KEY }}
DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}
# Create secret via GitHub CLI
gh secret set MY_SECRET --body "secret-value"
# Use in workflow
env:
MY_VAR: ${{ secrets.MY_SECRET }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 5
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: version
run: echo "version=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- run: npm run deploy
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
os: [ubuntu-latest, ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18, 20, 22]
exclude:
- os: windows-latest
node-version: 18 # Skip Windows with Node 18
name: Node.js Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run build
name: Docker Build & Push
on:
push:
branches: [main]
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
name: Deploy to Production
on:
workflow_dispatch:
inputs:
version:
description: 'Version to deploy'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
concurrency: production
steps:
- uses: actions/checkout@v4
with:
ref: v${{ github.event.inputs.version }}
- name: Deploy
run: |
curl -X POST https://api.example.com/deploy \
-H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" \
-d '{"version":"${{ github.event.inputs.version }}"}'
- name: Verify Deployment
run: |
for i in {1..30}; do
if curl -f https://api.example.com/health | grep -q "healthy"; then
echo "Deployment successful"
exit 0
fi
sleep 10
done
echo "Deployment failed"
exit 1
name: PR Quality Checks
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test
- uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
${{ github.repository }} # owner/repo
${{ github.ref }} # refs/heads/main
${{ github.ref_name }} # main
${{ github.sha }} # Full commit SHA
${{ github.actor }} # Username triggering workflow
${{ github.event_name }} # push, pull_request, etc.
${{ github.run_id }} # Unique run ID
${{ github.run_number }} # Sequential run number
${{ github.event.pull_request.number }} # PR number
${{ github.event.pull_request.title }} # PR title
${{ github.event.pull_request.head.sha }} # PR head commit
${{ github.event.pull_request.base.sha }} # PR base commit
main branchenv:
RUNNER_DEBUG: 1
ACTIONS_STEP_DEBUG: true
actActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.