Skip to content

Commit

Permalink
Remove old ecrRepositoryName input
Browse files Browse the repository at this point in the history
This should no longer be referenced by dependent workflows, in favor of
imageName.
  • Loading branch information
theseanything committed Jul 10, 2024
1 parent f8ef6d7 commit 57572f3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Build and push image
on:
workflow_call:
inputs:
ecrRepositoryName:
required: false
type: string
default: ${{ github.event.repository.name }}
imageName:
required: false
type: string
Expand Down Expand Up @@ -61,7 +57,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }}
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }}
tags: |
type=raw,priority=500,value=${{ inputs.gitRef }},enable=${{ startsWith(inputs.gitRef, 'v') }}
type=raw,priority=400,value=${{ steps.local-head.outputs.sha }},enable=${{ !startsWith(inputs.gitRef, 'v') }}
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/build-and-push-multiarch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Build and push multi-arch image
on:
workflow_call:
inputs:
ecrRepositoryName:
required: false
type: string
default: ${{ github.event.repository.name }}
imageName:
required: false
type: string
Expand All @@ -33,7 +29,7 @@ on:

jobs:
build-and-push-image:
name: Build and push image for ${{ inputs.ecrRepositoryName || inputs.imageName }}
name: Build and push image for ${{ inputs.imageName }}
strategy:
matrix:
arch:
Expand Down Expand Up @@ -75,7 +71,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }}
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }}
labels: |
org.opencontainers.image.vendor=GDS
tags: |
Expand All @@ -92,9 +88,9 @@ jobs:
provenance: false
build-args: ${{ inputs.buildArgs }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=build-${{ inputs.ecrRepositoryName || inputs.imageName }}-${{ matrix.arch }}
cache-to: type=gha,scope=build-${{ inputs.ecrRepositoryName || inputs.imageName }}-${{ matrix.arch }},mode=max
outputs: type=image,name=ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=build-${{ inputs.imageName }}-${{ matrix.arch }}
cache-to: type=gha,scope=build-${{ inputs.imageName }}-${{ matrix.arch }},mode=max

- id: export-digests
env:
Expand All @@ -106,7 +102,7 @@ jobs:
- id: upload-digests
uses: actions/upload-artifact@v4
with:
name: digests-${{ inputs.ecrRepositoryName || inputs.imageName }}-${{ matrix.arch }}
name: digests-${{ inputs.imageName }}-${{ matrix.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
Expand All @@ -126,7 +122,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-${{ inputs.ecrRepositoryName || inputs.imageName }}-*
pattern: digests-${{ inputs.imageName }}-*
merge-multiple: true

- uses: docker/setup-buildx-action@v3
Expand All @@ -146,7 +142,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }}
ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }}
labels: |
org.opencontainers.image.vendor=GDS
tags: |
Expand All @@ -156,7 +152,7 @@ jobs:
- name: Create Manifest Lists
env:
IMAGEREF_PREFIX: 'ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }}'
IMAGEREF_PREFIX: 'ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }}'
working-directory: /tmp/digests
run: |
tag_args=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
Expand All @@ -166,6 +162,6 @@ jobs:
- name: Inspect Images
env:
IMAGEREF: 'ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.ecrRepositoryName || inputs.imageName }}:${{ steps.meta.outputs.version }}'
IMAGEREF: 'ghcr.io/${{ github.repository_owner }}/govuk/${{ inputs.imageName }}:${{ steps.meta.outputs.version }}'
run: |
docker buildx imagetools inspect "$IMAGEREF"
2 changes: 1 addition & 1 deletion .github/workflows/build-clamav-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-multiarch-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.ref }}
ecrRepositoryName: clamav
imageName: clamav
dockerfilePath: images/clamav/Dockerfile
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mongodb-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-multiarch-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.ref }}
ecrRepositoryName: mongodb
imageName: mongodb
dockerfilePath: images/mongodb/Dockerfile
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-toolbox-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-multiarch-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.ref }}
ecrRepositoryName: toolbox
imageName: toolbox
dockerfilePath: images/toolbox/Dockerfile
permissions:
id-token: write
Expand Down

0 comments on commit 57572f3

Please sign in to comment.