04.GitHub Actions流水线

清夏晚风

CI/CD流水线配置

企业级流水线

1
2
3
4
5
6
7
graph LR
C[代码推送] -->|触发| A[GitHub Actions]
A --> B{安全检查}
B -->|通过| D[构建镜像]
D --> E[部署测试环境]
E --> F[自动化测试]
F --> G[生产发布]

复合工作流

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name: Enterprise CI
on:
workflow_dispatch:
push:
branches: [ main ]

jobs:
security-scan:
uses: ./.github/workflows/security.yml
secrets: inherit

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build with Docker
uses: docker/build-push-action@v3
with:
tags: ghcr.io/${{ github.repository }}:latest

deploy:
needs: [security-scan, build]
uses: ./.github/workflows/deploy-prod.yml
  • Title: 04.GitHub Actions流水线
  • Author: 清夏晚风
  • Created at : 2026-01-14 14:55:07
  • Updated at : 2026-01-14 14:55:07
  • Link: https://blog.kimikkorow.eu.org/版本控制管理/Github/04.GitHub Actions流水线/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
04.GitHub Actions流水线