xiaohongshu
xiaohongshu
ci-pipeline
GitHub Actions CI/CD pipelines with caching, matrix builds, and deployment strategies. Focuses on build speed, reliability, and security. Use when creating or optimizing CI/CD workflows, debugging pipeline failures, or implementing deployment automation.
Full skill instructions
GitHub Actions CI/CD patterns for reliable, fast pipelines.
# 1. Find existing workflows
serena.list_dir(".github/workflows")
# 2. Check workflow patterns
serena.search_for_pattern("uses:|run:|cache:|matrix:", paths_include_glob=".github/workflows/*.yml")
# 3. Find reusable workflows
jetbrains.search_in_files_by_text("workflow_call", fileMask="*.yml")
# 4. GitHub Actions docs
context7.get-library-docs("/github/actions", "caching")
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # Cancel outdated runs
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Job steps...
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-
- name: Cache pnpm
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: pnpm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: pnpm-${{ runner.os }}-
# Or use setup action with built-in cache
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Cache uv
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
restore-keys: uv-${{ runner.os }}-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build with cache
uses: docker/build-push-action@v6
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
jobs:
test:
strategy:
fail-fast: false # Don't cancel other jobs on failure
matrix:
os: [ubuntu-latest, macos-latest]
node: [20, 22]
exclude:
- os: macos-latest
node: 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- id: version
run: echo "value=$(cat version.txt)" >> $GITHUB_OUTPUT
deploy:
needs: [build, test] # Waits for both
if: success() # Only if both succeeded
runs-on: ubuntu-latest
steps:
- run: echo "Deploying ${{ needs.build.outputs.version }}"
# .github/workflows/build-and-test.yml
name: Build and Test
on:
workflow_call:
inputs:
node-version:
type: string
default: '22'
secrets:
npm-token:
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- run: npm ci
env:
NPM_TOKEN: ${{ secrets.npm-token }}
jobs:
build:
uses: ./.github/workflows/build-and-test.yml
with:
node-version: '22'
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
permissions:
contents: read
pull-requests: write # Only what's needed
jobs:
security:
runs-on: ubuntu-latest
permissions:
security-events: write # Job-level override
- name: Scan dependencies
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
severity: 'CRITICAL,HIGH'
exit-code: '1' # Fail on findings
- name: Check for secrets
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
jobs:
deploy-staging:
environment: staging
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh staging
deploy-production:
needs: deploy-staging
environment:
name: production
url: https://app.example.com
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh production
environment:
name: production
# Requires approval in repo settings
# Set secret ACTIONS_STEP_DEBUG=true
# Or re-run with debug logging enabled in UI
- name: Debug with tmate
if: failure()
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: debug-logs
path: |
**/logs/
**/test-results/
| Pattern | Problem | Solution |
|---|---|---|
| No cache | Slow builds | Add appropriate caching |
if: always() for deploy | Deploys broken code | Use if: success() |
| Secrets in logs | Security risk | Use ::add-mask:: |
| Single monolith job | Slow, no parallelism | Split into dependent jobs |
No concurrency | Wasted resources | Cancel outdated runs |
| Hardcoded versions | Drift | Use variables or renovate |
concurrency cancels outdated runsfail-fast: true for matrix (if appropriate)sparse-checkout)ubuntu-latest (faster than macos/windows)permissions uses least privilegexiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience