Ci pipeline setup
Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/doyajin174/ci-pipeline-setup
π§ The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.
npx -y skills add ComeOnOliver/skillshub --skill ci-pipeline-setupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Set up CI/CD pipelines with GitHub Actions. Use when creating new projects, adding automation, or when manual verification becomes bottleneck. Covers lint, test, build, deploy automation.
The file declares its own license as MIT. That is the authorβs claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
8.9 KB, as published. Nobody here has run it
CI Pipeline Setup
GitHub Actionsλ₯Ό μ΄μ©ν CI/CD νμ΄νλΌμΈ μ€μ μ€ν¬μ λλ€.
Core Principle
"verification-before-completionμ λ‘컬μμλ§ νμ§ λ§κ³ , μ격 μ μ₯μμμ μλμΌλ‘ κ°μ νλ€." "λ¨Έμ§ μ μ CIκ° ν΅κ³Όν΄μΌ νλ€ = μμ€ν μΌλ‘ κ°μ "
νμ νμ΄νλΌμΈ λ¨κ³
| λ¨κ³ | λͺ©μ | μ€ν¨ μ |
|---|---|---|
| Lint | μ½λ μ€νμΌ μΌκ΄μ± | PR λ¨Έμ§ μ°¨λ¨ |
| Type Check | νμ μμ μ± κ²μ¦ | PR λ¨Έμ§ μ°¨λ¨ |
| Test | κΈ°λ₯ μ νμ± κ²μ¦ | PR λ¨Έμ§ μ°¨λ¨ |
| Build | λΉλ κ°λ₯ μ¬λΆ νμΈ | PR λ¨Έμ§ μ°¨λ¨ |
| Security | μ·¨μ½μ μ€μΊ | PR λ¨Έμ§ μ°¨λ¨ |
κΈ°λ³Έ CI μν¬νλ‘μ°
.github/workflows/ci.yml
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
# λμ μ€ν μ μ΄ (κ°μ PRμ μ μ»€λ° μ μ΄μ μ€ν μ·¨μ)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ================================
# 1. μ½λ νμ§ κ²μ¬
# ================================
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Check formatting
run: npm run format:check
# ================================
# 2. νμ
κ²μ¬
# ================================
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run TypeScript
run: npm run typecheck
# ================================
# 3. ν
μ€νΈ
# ================================
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
# ================================
# 4. λΉλ
# ================================
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, typecheck, test]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: .next/
retention-days: 7
# ================================
# 5. 보μ μ€μΊ
# ================================
security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run npm audit
run: npm audit --audit-level=high
package.json μ€ν¬λ¦½νΈ
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:ci": "vitest --run --coverage"
}
}
Branch Protection Rules
GitHub μ€μ λ°©λ²
Settings β Branches β Add rule
Branch name pattern: main
β
Require a pull request before merging
β
Require approvals (μ΅μ 1λͺ
)
β
Dismiss stale pull request approvals when new commits are pushed
β
Require status checks to pass before merging
β
Require branches to be up to date before merging
Status checks:
- lint
- typecheck
- test
- build
- security
β
Require conversation resolution before merging
β
Do not allow bypassing the above settings
branch-protection.yml (μλ μ€μ μ©)
# .github/branch-protection.yml
branches:
- name: main
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
required_status_checks:
strict: true
contexts:
- lint
- typecheck
- test
- build
- security
enforce_admins: true
restrictions: null
κ³ κΈ ν¨ν΄
Matrix λΉλ (λ€μ€ νκ²½)
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 }}
- run: npm ci
- run: npm test
μΊμ μ΅μ ν
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
PR λΌλ²¨ μλν
# .github/workflows/labeler.yml
name: Labeler
on:
pull_request:
types: [opened, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
μμ‘΄μ± μλ μ λ°μ΄νΈ (Dependabot)
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
labels:
- "dependencies"
groups:
dev-dependencies:
patterns:
- "@types/*"
- "eslint*"
- "prettier*"
λ°°ν¬ νμ΄νλΌμΈ (CD)
Vercel μλ λ°°ν¬
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
needs: [lint, typecheck, test, build]
steps:
- uses: actions/checkout@v4
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
Preview λ°°ν¬ (PRλ³)
# PRμμ μλμΌλ‘ Preview URL μμ±
on:
pull_request:
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
# --prod μμ = Preview λ°°ν¬
Workflow νμΌ κ΅¬μ‘°
.github/
βββ workflows/
β βββ ci.yml # λ©μΈ CI (lint, test, build)
β βββ deploy.yml # νλ‘λμ
λ°°ν¬
β βββ preview.yml # PR Preview λ°°ν¬
β βββ labeler.yml # λΌλ²¨ μλν
βββ dependabot.yml # μμ‘΄μ± μ
λ°μ΄νΈ
βββ CODEOWNERS # μ½λ μμ μ
βββ PULL_REQUEST_TEMPLATE.md
Checklist
μ νλ‘μ νΈ
-
.github/workflows/ci.ymlμμ± - package.json μ€ν¬λ¦½νΈ μ μ (lint, typecheck, test, build)
- Branch Protection Rules μ€μ
- Dependabot μ€μ
- CODEOWNERS νμΌ μμ±
CI νμ§
- λͺ¨λ PRμμ CI νμ ν΅κ³Ό
- μΊμ μ΅μ νλ‘ λΉλ μκ° λ¨μΆ
- λ³λ ¬ μ€νμΌλ‘ ν¨μ¨μ± μ¦κ°
- μ€ν¨ μ λͺ νν μλ¬ λ©μμ§
보μ
- Secretsλ GitHub Secretsμλ§ μ μ₯
- npm audit μλ μ€ν
- μμ‘΄μ± μλ μ λ°μ΄νΈ νμ±ν