This repository hosts a collection of reusable GitHub Actions workflows for AP‑HP projects.
The goal is to centralize CI/CD best practices (linting, security scans, packaging and publishing) so that each project can:
- reuse the same, opinionated workflows,
- get consistent quality and security checks,
- keep CI configuration as small as possible.
Current workflows mainly target:
- Container images (build, scan and push to GHCR),
- Helm charts (lint, test, secure, document and publish).
- Overview
- Available reusable workflows
- How to call a reusable workflow
- Branching, versions and environments
- Contributing
- License
All workflows are stored under:
.github/workflows/
You do not copy these YAML files into your own repositories.
Instead, your project calls them as reusable workflows using the uses: syntax described in the GitHub Actions documentation.
This repository is meant to be used across all AP‑HP GitHub projects that need a standard CI pipeline for:
- building and scanning Docker images,
- validating, scanning and releasing Helm charts.
Below is an overview of the main families of workflows currently documented.
Provides security and quality checks for container images before pushing them to your project’s GitHub Container Registry (GHCR).
Typical use cases:
- container images for applications (e.g. APIs, frontends, backends),
- base or runtime images (e.g. Jupyter EDS notebooks images),
- internal utilities or tools.
The workflow chains several tools:
- Hadolint
- Linting of
Dockerfile(style, best practices, common pitfalls).
- Linting of
- Buildx
- Docker image build (supports advanced features like build kits, multi‑arch, extra build args…).
- Dockle
- Image scan for misconfigurations and bad patterns.
- Trivy
- Vulnerability scanning of images.
- License scanning of included dependencies.
- Docker / GHCR
- Push of validated images to your project’s GHCR repository.
All tools that support it produce SARIF reports, automatically uploaded to your repository:
- GitHub UI:
Securitytab →Code scanningsection. - You can browse findings by tool, severity, and impacted files.
- Works out of the box for public repositories.
- For private repositories, you may need to:
- adjust Actions permissions so the workflow can push to your private GHCR,
- ensure the workflow can write packages (GHCR).
The exact permission model may depend on your organization policies; coordinate with your AP‑HP GitHub admins if needed.
Inputs currently supported by the container images workflow:
| Input | Type | Required | Default | Description |
|---|---|---|---|---|
dockerfile-path |
string | No | Dockerfile |
Path to the Dockerfile of your project. |
hadolint-ignore |
string | No | "" |
Comma‑separated list of Hadolint rule IDs to ignore in blocking checks. Findings still appear in reports. |
image-name |
string | Yes | – | Full image name including registry and repository, e.g. ghcr.io/aphp/my-service. |
image-custom-tag |
string | No | "" |
Custom tag added in addition to automatically generated tags. Typical values: x86_64-ubuntu-24.04, x86_64-ubuntu-24.04-dev, nightly. |
extra-build-args |
string | No | "" |
Extra Docker build arguments, provided as KEY=VALUE. Usually passed as a multiline YAML scalar (one KEY=VALUE per line). |
dockle-ignore |
string | No | "" |
Comma‑separated list of Dockle rule IDs to ignore in blocking checks. |
dockle-accept-file |
string | No | "" |
Comma‑separated list of file names to accept in Dockle (--accept-file). |
dockle-accept-key |
string | No | "" |
Comma‑separated list of keys to accept in Dockle (--accept-key). |
trivy-ignore-vuln-ids |
string | No | "" |
List of vulnerability IDs (CVE-…, GHSA-…, AVD-…) to ignore for blocking Trivy checks. Can be comma‑separated or one per line. |
trivy-ignore-license-ids |
string | No | "" |
List of license identifiers (e.g. GPL-3.0-only, MIT) to ignore in blocking Trivy license checks. Can be comma‑separated or one per line. |
Always refer to the workflow file in .github/workflows/ for the most up‑to‑date list of inputs and defaults.
The workflow relies on a combination of actions and steps to handle image tagging and publishing:
- During the build step, tags are computed according to Docker Metadata Action rules.
- If all scans pass successfully:
- the previously tagged image is pushed to your project’s GHCR repository.
This behavior directly impacts your release and tagging strategy; make sure to align it with your project’s lifecycle (branching model, tags, environments).
Provides security and quality checks for Helm charts, and automates publishing to a Helm repository hosted via your project’s GitHub Pages (gh-pages branch).
Typical use cases:
- Helm charts for applications like HELIX, REDCap, etc.,
- any Kubernetes deployment managed via Helm within AP‑HP projects.
The Helm charts workflow is organized by job:
-
Linting (
lint-testjob)ct lint(Helm chart-testing),kubeconform(Kubernetes manifest validation against schemas).
-
Security (
lint-testjob)- Polaris (configuration and security best practices),
- Trivy (vulnerability scanning on rendered manifests).
-
Documentation (
generate-docjob)- helm-docs (README / values documentation from chart),
- Values schema JSON generation (for validation and tooling).
-
Publishing (
releasejob)- helm/chart-releaser to package charts and update the Helm index.
Some tools (currently Trivy) generate SARIF reports, uploaded to:
Securitytab →Code scanning.
This allows you to track vulnerabilities and security issues directly in GitHub.
To be able to publish charts and use the repository as a Helm repository, ensure:
-
A branch named
gh-pagesexists in your repository. -
In your repository Settings:
Code and automation / Pages→Branch: selectgh-pages.
-
In Settings → Actions → General:
Actions permissions: set to Allow all actions and reusable workflows.Workflow permissions: set to Read and write permissions.
-
Your chart lives under a
chartsdirectory at the repository root:charts/ mychart/ Chart.yaml values.yaml templates/...
Inputs currently supported by the Helm charts workflow:
| Input | Type | Required | Default | Description |
|---|---|---|---|---|
chart-dir |
string | Yes | chart |
Directory containing your Helm chart (must contain a Chart.yaml). |
chart-values |
string | No | chart/values.yaml |
Values file used for kubeconform, Polaris, Trivy and ct install tests. |
kubernetes-version |
string | No | 1.24.2 |
Target Kubernetes version used by kubeconform and Trivy for validations and scans. |
Again, always check the workflow file in .github/workflows/ for the authoritative list of inputs.
Chart releases are handled via the Helm CR action, with behavior depending on the branch:
-
On
featurebranch:- Chart version in
Chart.yamlis suffixed with-snapshot, - A Git tag is created with this snapshot version,
- A Release is created containing the snapshot chart archive,
index.yamlin thegh-pagesbranch is updated to reference the new snapshot chart.
- Chart version in
-
On
devbranch:- Chart version in
Chart.yamlis suffixed with-dev, - A Git tag is created with this dev version,
- A Release is created containing the dev chart archive,
index.yamlin thegh-pagesbranch is updated to reference the new dev chart.
- Chart version in
-
On
mainbranch:- A Git tag is created with the chart version from
Chart.yaml, - A Release is created with the chart archive, marked as latest,
index.yamlingh-pagesis updated to reference the new stable chart.
- A Git tag is created with the chart version from
This gives you a standard separation between snapshot,dev and stable releases for Helm charts.
To use one of these workflows from another repository:
-
Create a workflow file in your project, e.g.:
.github/workflows/container-ci.yml -
In that file, define a job that uses one of the workflows from this repo:
name: Container CI on: push: branches: [ main, dev ] pull_request:
permissions: contents: write security-events: write
jobs: container-ci: uses: aphp/ci-workflows/.github/workflows/.yml@main with: image-name: ghcr.io/aphp/my-service dockerfile-path: Dockerfile image-custom-tag: x86_64-ubuntu-24.04
3. For Helm charts, a similar pattern applies:
```yaml
name: Helm Chart CI
on:
push:
branches: [ main, dev ]
pull_request:
permissions:
contents: write
security-events: write
jobs:
helm-ci:
uses: aphp/ci-workflows/.github/workflows/<helm-workflow-filename>.yml@main
with:
chart-dir: charts/mychart
chart-values: charts/mychart/values.yaml
kubernetes-version: "1.24.2"
Replace
<container-workflow-filename>.ymland<helm-workflow-filename>.ymlwith the actual filenames from this repository’s.github/workflowsdirectory.
For a concrete example of usage, you can refer to a project CI configuration that calls these workflows (e.g. container image or Helm chart repositories within the AP‑HP GitHub organization).
This repository is versioned like any other Git repository:
- Branches such as
feature,devormainrepresent the maturity of workflows. - In your consuming projects, you should:
- Prefer tags (once defined) for stable usage, e.g.
@v1, - Use the
devbranch (@dev) when experimenting or adopting new features early.
- Prefer tags (once defined) for stable usage, e.g.
note: feature name is the name of your branch created from Issue.
Examples:
-
Stable usage (recommended when available):
uses: aphp/ci-workflows/.github/workflows/<workflow>.yml@v1
-
Development usage (bleeding edge):
uses: aphp/ci-workflows/.github/workflows/<workflow>.yml@dev
Coordinate with the AP‑HP CI maintainers to know which refs are recommended for production usage.
Contributions, bug reports and improvement ideas are welcome.
- See
CONTRIBUTING.mdfor:- coding standards,
- how to run tests/linters locally,
- the release workflow for this repository.
- Use GitHub Issues to:
- report problems with existing workflows,
- request new reusable workflows,
- ask for documentation improvements.
Before opening a pull request:
- Check there is an existing issue (or open a new one) describing the change.
- Update or add documentation for new inputs/behavior.
- Run relevant tests or dry‑runs for the workflows you modify.
This project is licensed under the Apache License 2.0.
- See
LICENSEfor details.
By contributing to this repository, you agree that your contributions will be licensed under the same terms.