|
1 | 1 | # eps-workflow-quality-checks |
2 | 2 |
|
| 3 | +This repository provides reusable GitHub Actions workflows for EPS repositories: |
3 | 4 |
|
4 | | -A workflow to run the quality checks for EPS repositories. The main element of this lives in the [`quality-checks.yml`](./.github/workflows/quality-checks.yml) configuration file. The steps executed by this workflow are as follows: |
| 5 | +1. **Quality Checks Workflow** ([`quality-checks.yml`](./.github/workflows/quality-checks.yml)) - Comprehensive quality checks including linting, testing, security scanning, and dev container building |
| 6 | +2. **Tag Latest Dev Container Workflow** ([`tag_latest_dev_container.yml`](./.github/workflows/tag_latest_dev_container.yml)) - Tags dev container images with version and latest tags |
| 7 | + |
| 8 | +## Quality Checks Workflow |
| 9 | + |
| 10 | +The main quality checks workflow runs comprehensive checks for EPS repositories. The steps executed by this workflow are as follows: |
5 | 11 |
|
6 | 12 | - **Install Project Dependencies** |
7 | 13 | - **Generate and Check SBOMs**: Creates Software Bill of Materials (SBOMs) to track dependencies for security and compliance. Uses [THIS](https://github.com/NHSDigital/eps-action-sbom) action. |
|
52 | 58 | language: system |
53 | 59 | ``` |
54 | 60 |
|
55 | | -# Usage |
| 61 | +# Quality Checks Workflow Usage |
56 | 62 |
|
57 | 63 | ## Inputs |
58 | 64 |
|
@@ -119,7 +125,7 @@ The workflow requires the following secrets: |
119 | 125 | - **Required**: true |
120 | 126 | - **Description**: AWS IAM role ARN used to authenticate and push dev container images to ECR. |
121 | 127 |
|
122 | | -# Example Workflow Call |
| 128 | +## Example Workflow Call |
123 | 129 |
|
124 | 130 | To use this workflow in your repository, call it from another workflow file: |
125 | 131 |
|
@@ -148,3 +154,57 @@ jobs: |
148 | 154 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
149 | 155 | PUSH_IMAGE_ROLE: ${{ secrets.DEV_CONTAINER_PUSH_IMAGE_ROLE }} |
150 | 156 | ``` |
| 157 | + |
| 158 | +# Tag Latest Dev Container Workflow |
| 159 | + |
| 160 | +This repository also provides a reusable workflow [`tag_latest_dev_container.yml`](./.github/workflows/tag_latest_dev_container.yml) for tagging dev container images with version tags and `latest` in ECR. |
| 161 | + |
| 162 | +## Purpose |
| 163 | + |
| 164 | +This workflow takes existing dev container images (built for both x64 and arm64 architectures) and applies additional tags to them, including: |
| 165 | +- A custom version tag (e.g., `v1.0.0`) |
| 166 | +- The `latest` tag |
| 167 | +- Architecture-specific tags (e.g., `v1.0.0-amd64`, `latest-arm64`) |
| 168 | + |
| 169 | +## Inputs |
| 170 | + |
| 171 | +### `dev_container_ecr` |
| 172 | +- **Type**: string |
| 173 | +- **Required**: true |
| 174 | +- **Description**: The name of the ECR repository containing the dev container images. |
| 175 | + |
| 176 | +### `dev_container_image_tag` |
| 177 | +- **Type**: string |
| 178 | +- **Required**: true |
| 179 | +- **Description**: The current tag of the dev container images to be re-tagged (should exist for both `-amd64` and `-arm64` suffixes). |
| 180 | + |
| 181 | +### `version_tag_to_apply` |
| 182 | +- **Type**: string |
| 183 | +- **Required**: true |
| 184 | +- **Description**: The version tag to apply to the dev container images (e.g., `v1.0.0`). |
| 185 | + |
| 186 | +## Secrets |
| 187 | + |
| 188 | +### `PUSH_IMAGE_ROLE` |
| 189 | +- **Required**: true |
| 190 | +- **Description**: AWS IAM role ARN used to authenticate and push images to ECR. |
| 191 | + |
| 192 | +## Example Usage |
| 193 | + |
| 194 | +```yaml |
| 195 | +name: Tag Dev Container as Latest |
| 196 | +
|
| 197 | +on: |
| 198 | + release: |
| 199 | + types: [published] |
| 200 | +
|
| 201 | +jobs: |
| 202 | + tag_dev_container: |
| 203 | + uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/tag_latest_dev_container.yml@main |
| 204 | + with: |
| 205 | + dev_container_ecr: "your-ecr-repo-name" |
| 206 | + dev_container_image_tag: "build-123" # The tag created by quality-checks workflow |
| 207 | + version_tag_to_apply: ${{ github.event.release.tag_name }} |
| 208 | + secrets: |
| 209 | + PUSH_IMAGE_ROLE: ${{ secrets.DEV_CONTAINER_PUSH_IMAGE_ROLE }} |
| 210 | +``` |
0 commit comments