Skip to content

feat: push to GHCR as secondary registry + Trivy CVE scanning in PR checks#114

Merged
jorge07 merged 1 commit intojorge07:masterfrom
josecarlospeer-cloud:feat/ci-ghcr-trivy
Feb 22, 2026
Merged

feat: push to GHCR as secondary registry + Trivy CVE scanning in PR checks#114
jorge07 merged 1 commit intojorge07:masterfrom
josecarlospeer-cloud:feat/ci-ghcr-trivy

Conversation

@josecarlospeer-cloud
Copy link
Contributor

Closes #103 (GHCR + Trivy items — Dependabot already active)

GHCR as secondary registry (release.yaml)

After Docker Hub push, all tags are mirrored to ghcr.io/jorge07/alpine-php via docker buildx imagetools create. This copies the manifest without rebuilding — zero extra CI minutes.

Tags mirrored per version:

  • ghcr.io/jorge07/alpine-php:8.x
  • ghcr.io/jorge07/alpine-php:8.x-dev
  • ghcr.io/jorge07/alpine-php:8.x.y (semver)
  • ghcr.io/jorge07/alpine-php:8.x.y-dev

Uses GITHUB_TOKEN (automatically available, no secret needed). Added packages: write permission.

Trivy CVE scanning (pr.yaml)

Added aquasecurity/trivy-action@0.29.0 scan after the build step:

  • Scans the main image (jorge07/alpine-php:${{ matrix.version }})
  • Fails CI on CRITICAL severity only, with a fix available (ignore-unfixed: true)
  • Scans OS packages and libraries
  • Results in table format for easy reading in CI logs

Dependabot (already configured for github-actions) will keep trivy-action up to date automatically.

…hecks

release.yaml:
- Add 'Login to GHCR' step (docker/login-action@v3, GITHUB_TOKEN)
- After Docker Hub push, mirror all tags to ghcr.io/jorge07/alpine-php
  via 'docker buildx imagetools create' (zero-rebuild, copies the manifest)
- Add packages: write permission for GITHUB_TOKEN

pr.yaml:
- Add Trivy vulnerability scan step after image build
- Uses aquasecurity/trivy-action@0.29.0
- Scans jorge07/alpine-php:${VERSION} (main image, not dev)
- Fails CI on CRITICAL severity with a fix available (ignore-unfixed: true)
- Scans os and library vuln types

Dependabot (already configured) will keep trivy-action pinned up to date.

Closes jorge07#103 (GHCR + Trivy items)
@jorge07 jorge07 merged commit 3a0d934 into jorge07:master Feb 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: CI/CD modernisation

2 participants