CI/CD and GitHub Actions
Purpose: Author reproducible CI workflows that enforce quality gates (build, tests, lint, security) and automate release steps.
Key topics:
- Workflow templates for PR validation and release pipelines
- Artifact build and publish steps (Maven/Gradle, Docker images)
- Security and dependency scanning integration (Snyk, oss-audit)
- Policy gates and required checks configuration
Required inputs:
- Repository build matrix, required checks list
Outputs:
- Reusable workflow YAMLs, status badge, CI runbooks
Success criteria:
- CI workflows run on PRs and produce deterministic results
- Blocking gates configured for tests and security scans
name: ci-cd-github-actions
description: CI/CD guidance and reusable GitHub Actions workflows for build, test, security scanning, and release.
CI/CD and GitHub Actions
Purpose: Author reproducible CI workflows that enforce quality gates (build, tests, lint, security) and automate release steps.
Key topics:
- Workflow templates for PR validation and release pipelines
- Artifact build and publish steps (Maven/Gradle, Docker images)
- Security and dependency scanning integration (Snyk, oss-audit)
- Policy gates and required checks configuration
Quick GitHub Actions PR-validation snippet (example):
name: PR Validation
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Build & Test
run: mvn -B -DskipTests=false verify
- name: Run Snyk
if: success()
run: snyk test || true
Best practices:
- Keep PR workflows fast: run unit tests and quick integration smoke tests.
- Run longer integration tests and heavy scans on schedule or on-demand pipeline.
- Use caching for Maven/Gradle artifacts to speed up CI.
Security scanning integration:
snyk test and snyk monitor can be included as steps; allow snyk to fail the job only on policy severity levels you enforce.
- Add
dependency-check or oss-audit as supplementary scans.
Release & artifact publishing:
- Build Docker images in CI, tag with PR/branch identifiers, push to private registry in release pipelines.
- Publish Maven artifacts to repository manager (Nexus/Artifactory) from release workflows.
Policy gates:
- Configure branch protection rules to require passing checks: build, unit tests, security scan, and at least one approving review.
CI runbooks & troubleshooting:
- Document common failures (flaky tests, environment variables) and recommended remediation steps in
.github/ci/README.md.
Source: dennisholee/IntegrationHub — distributed by TomeVault.
1---2name: ci-cd-github-actions-23description: CI/CD guidance and reusable GitHub Actions workflows for build, test, security scanning, and release. Use when this capability is needed.4---56# CI/CD and GitHub Actions78Purpose: Author reproducible CI workflows that enforce quality gates (build, tests, lint, security) and automate release steps.910Key topics:11- Workflow templates for PR validation and release pipelines12- Artifact build and publish steps (Maven/Gradle, Docker images)13- Security and dependency scanning integration (Snyk, oss-audit)14- Policy gates and required checks configuration1516Required inputs:17- Repository build matrix, required checks list1819Outputs:20- Reusable workflow YAMLs, status badge, CI runbooks2122Success criteria:23- CI workflows run on PRs and produce deterministic results24- Blocking gates configured for tests and security scans25---26name: ci-cd-github-actions27description: CI/CD guidance and reusable GitHub Actions workflows for build, test, security scanning, and release.28---2930# CI/CD and GitHub Actions3132Purpose: Author reproducible CI workflows that enforce quality gates (build, tests, lint, security) and automate release steps.3334Key topics:35- Workflow templates for PR validation and release pipelines36- Artifact build and publish steps (Maven/Gradle, Docker images)37- Security and dependency scanning integration (Snyk, oss-audit)38- Policy gates and required checks configuration3940Quick GitHub Actions PR-validation snippet (example):41```yaml42name: PR Validation43on: [pull_request]44jobs:45 build:46 runs-on: ubuntu-latest47 strategy:48 matrix:49 java: [17, 21]50 steps:51 - uses: actions/checkout@v452 - uses: actions/setup-java@v453 with:54 java-version: ${{ matrix.java }}55 - name: Cache Maven56 uses: actions/cache@v457 with:58 path: ~/.m2/repository59 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}60 - name: Build & Test61 run: mvn -B -DskipTests=false verify62 - name: Run Snyk63 if: success()64 run: snyk test || true65```6667Best practices:68- Keep PR workflows fast: run unit tests and quick integration smoke tests.69- Run longer integration tests and heavy scans on schedule or on-demand pipeline.70- Use caching for Maven/Gradle artifacts to speed up CI.7172Security scanning integration:73- `snyk test` and `snyk monitor` can be included as steps; allow `snyk` to fail the job only on policy severity levels you enforce.74- Add `dependency-check` or `oss-audit` as supplementary scans.7576Release & artifact publishing:77- Build Docker images in CI, tag with PR/branch identifiers, push to private registry in release pipelines.78- Publish Maven artifacts to repository manager (Nexus/Artifactory) from release workflows.7980Policy gates:81- Configure branch protection rules to require passing checks: build, unit tests, security scan, and at least one approving review.8283CI runbooks & troubleshooting:84- Document common failures (flaky tests, environment variables) and recommended remediation steps in `.github/ci/README.md`.8586---87> Source: [dennisholee/IntegrationHub](https://github.com/dennisholee/IntegrationHub) — distributed by [TomeVault](https://tomevault.io).88<!-- tomevault:4.0:skill_md:2026-05-22 -->