Skip to content

Commit cc2fef8

Browse files
author
Jacob Woffenden
committed
Adds feature publishing
Drops versions to 0.0.1 Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
1 parent d17f6b3 commit cc2fef8

File tree

10 files changed

+81
-12
lines changed

10 files changed

+81
-12
lines changed

.github/workflows/features.yml

+30-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ jobs:
108108
- name: Evaluate Checks
109109
id: evaluate_checks
110110
run: |
111-
echo "::notice::# Preflight Checks"
112-
113111
if [[ "${{ env.tag_exists }}" == "true" ]]; then
114112
echo "::error::FAIL: Feature tag already exists"
115113
export failBuild="true"
@@ -196,3 +194,33 @@ jobs:
196194
with:
197195
validate-only: true
198196
base-path-to-features: features/src
197+
198+
publish:
199+
needs: [detect-changes]
200+
if: ${{ needs.detect-changes.outputs.features != '[]' && github.ref == 'refs/heads/main' }}
201+
name: Publish
202+
runs-on: ubuntu-latest
203+
permissions:
204+
contents: read
205+
id-token: write
206+
packages: write
207+
strategy:
208+
fail-fast: false
209+
matrix:
210+
feature: ${{ fromJson(needs.detect-changes.outputs.features) }}
211+
steps:
212+
- name: Checkout
213+
id: checkout
214+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
215+
216+
- name: Install @devcontainers/cli
217+
id: install_devcontainers_cli
218+
run: npm install --global @devcontainers/cli@latest
219+
220+
- name: Publish
221+
id: publish
222+
run: |
223+
devcontainer features publish \
224+
--registry ghcr.io \
225+
--namespace ministryofjustice/devcontainer-feature \
226+
./features/src/aws/

.github/workflows/images.yml

+43-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ jobs:
108108
- name: Evaluate Checks
109109
id: evaluate_checks
110110
run: |
111-
echo "::notice::# Preflight Checks"
112-
113111
if [[ "${{ env.tag_exists }}" == "true" ]]; then
114112
echo "::error::FAIL: Container tag already exists"
115113
export failBuild="true"
@@ -184,3 +182,46 @@ jobs:
184182
exit-code: 1
185183
severity: HIGH,CRITICAL
186184
hide-progress: true
185+
186+
publish:
187+
needs: [detect-changes]
188+
if: ${{ needs.detect-changes.outputs.images != '[]' && github.ref == 'refs/heads/main' }}
189+
name: Publish
190+
runs-on: ubuntu-latest
191+
permissions:
192+
contents: read
193+
id-token: write
194+
packages: write
195+
strategy:
196+
fail-fast: false
197+
matrix:
198+
image: ${{ fromJson(needs.detect-changes.outputs.images) }}
199+
steps:
200+
- name: Checkout
201+
id: checkout
202+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
203+
204+
- name: Set Up QEMU
205+
id: setup_qemu
206+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
207+
208+
- name: Set Up Docker Buildx
209+
id: setup_docker_buildx
210+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
211+
212+
- name: Prepare Environment
213+
id: prepare_environment
214+
run: |
215+
version=$(jq -r '.version' images/${{ matrix.image }}/config.json)
216+
echo "version=${version}" >>"${GITHUB_ENV}"
217+
218+
- name: Publish Image
219+
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
220+
with:
221+
file: images/${{ matrix.image }}/Dockerfile
222+
context: images/${{ matrix.image }}
223+
platforms: linux/amd64,linux/arm64
224+
push: true
225+
tags: |
226+
ghcr.io/ministryofjustice/devcontainer-${{ matrix.image }}:${{ env.version }}
227+
ghcr.io/ministryofjustice/devcontainer-${{ matrix.image }}:latest

features/src/aws/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11-
## [1.0.0] - 2024-25-01
11+
## [0.0.1] - 2024-25-01
1212

1313
### Added
1414

features/src/aws/devcontainer-feature.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "aws",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"name": "AWS",
55
"description": "Installs the AWS CLI and AWS SSO CLI",
66
"options": {

features/src/kubernetes/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11-
## [1.0.0] - 2024-25-01
11+
## [0.0.1] - 2024-25-01
1212

1313
### Added
1414

features/src/kubernetes/devcontainer-feature.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "kubernetes",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"name": "Kubernetes",
55
"description": "Installs the Kubernetes CLI",
66
"options": {

features/src/terraform/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11-
## [1.0.0] - 2024-25-01
11+
## [0.0.1] - 2024-25-01
1212

1313
### Added
1414

features/src/terraform/devcontainer-feature.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "terraform",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"name": "Terraform",
55
"description": "Installs the Terraform CLI",
66
"options": {

images/base/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11-
## [1.0.0] - 2024-25-01
11+
## [0.0.1] - 2024-25-01
1212

1313
### Added
1414

images/base/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "base",
3-
"version": "1.0.0"
3+
"version": "0.0.1"
44
}

0 commit comments

Comments
 (0)