@@ -75,14 +75,15 @@ LuaJIT is configured with `LUAJIT_NUMMODE=2` (number mode) and Lua 5.2 compatibi
7575
7676## CI/CD Pipeline
7777
78- ### GitHub Actions Workflow
78+ ### GitHub Actions Workflows
7979
80- The repository uses ` .github/workflows/docker-build.yml ` for automated builds with a multi-stage digest-based approach:
80+ The repository uses two separate workflows for improved security and clarity:
81+
82+ #### 1. Build and Push (` .github/workflows/build-and-push.yaml ` )
8183
8284** Triggers** :
8385- Push to ` master ` /` main ` branch → Build & push to Docker Hub
8486- Tags matching ` *.*.*.*-* ` (e.g., ` 1.27.1.2-0 ` ) → Build & push with version tags
85- - Pull requests → Security scan only (no build)
8687- Manual dispatch → Build & push
8788
8889** Generated Docker Tags** :
@@ -91,39 +92,45 @@ The repository uses `.github/workflows/docker-build.yml` for automated builds wi
9192- ` 1.27 ` - Two-part version
9293
9394** Required Secrets** :
94- - ` DOCKER_HUB_USERNAME ` - Docker Hub username
95- - ` DOCKER_HUB_TOKEN ` - Docker Hub access token with Read & Write permissions
95+ - ` DOCKERHUB_USERNAME ` (variable) - Docker Hub username
96+ - ` DOCKERHUB_PUSH_TOKEN ` (secret) - Docker Hub access token with Read & Write permissions
97+
98+ #### 2. Security Scan (` .github/workflows/security-scan.yaml ` )
99+
100+ ** Triggers** :
101+ - Pull requests to ` master ` /` main ` branch
102+
103+ ** Purpose** :
104+ - Runs Trivy configuration scanner on Dockerfile and workflow files
105+ - Uploads results to GitHub Security tab
106+ - ** No Docker Hub access or secrets required** - provides fast security feedback in isolation
96107
97108### Build Architecture
98109
99- The workflow uses a three-stage process for efficient multi-platform builds:
110+ The build-and-push workflow uses a three-stage process for efficient multi-platform builds:
100111
1011121 . ** build** (matrix job):
102113 - Runs on native runners: ` ubuntu-latest ` (amd64), ` ubuntu-latest-arm ` (arm64)
103114 - Each platform builds independently in parallel
104115 - Uses digest-based push (` push-by-digest=true ` ) for reliable multi-arch images
105116 - Platform-specific cache scopes for optimal cache utilization
106- - Skipped for pull requests
107117
1081182 . ** merge** :
109119 - Downloads all platform digests
110120 - Creates manifest list using ` docker buildx imagetools create `
111121 - Pushes unified multi-platform image with appropriate tags
112122 - Runs Docker Scout CVE scan on final image
113123
114- 3 . ** security-scan** (PR only):
115- - Runs Trivy configuration scanner
116- - Uploads results to GitHub Security tab
117- - Provides fast feedback without building images
118-
119124### Security Features
120125
126+ - ** Workflow Separation** : Build and security-scan workflows are completely isolated
127+ - PRs never trigger workflows that access Docker Hub secrets
128+ - Reduces attack surface for public repository
121129- ** SBOM Generation** : Enabled (` sbom: true ` ) for all builds to track dependencies
122130- ** Provenance** : Disabled (` provenance: false ` ) for maximum compatibility with cloud services (ECR, ACR, GCR)
123131- ** Vulnerability Scanning** :
124132 - Docker Scout (post-merge): Scans final multi-platform image for critical/high CVEs
125133 - Trivy (PRs only): Scans Dockerfile and configuration, uploads to GitHub Security
126- - ** Pull Request Isolation** : PRs run security scans only, no Docker builds or Docker Hub access
127134
128135### Build Optimization
129136
0 commit comments