Chuyển tới nội dung chính
kitlocal.dev

Trình tạo Pipeline CI/CD

Chạy cục bộ

Xử lý 100% ngay trong trình duyệt. Dữ liệu đầu vào và kết quả không rời khỏi thiết bị.

Tạo cấu hình quy trình CI/CD chuẩn YAML cho GitHub Actions

Các bước thực thi Pipeline
YAML cấu hình GitHub Actions
name: Node.js Pipeline

on:
  push:
    branches: ["main", "develop"]
  pull_request:
    branches: ["main", "develop"]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: ["18.x"]

    steps:
    - uses: actions/checkout@v4
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Execute Clean Installation
      run: npm ci
    - name: Run Core Test Boundaries
      run: npm test
    - name: Compile Pipeline Release Target
      run: npm run build
Lưu tệp cấu hình vào đường dẫn .github/workflows/main.yml