Skip to content

Commit

Permalink
Merge pull request #104 from alphagov/sengi/actionlint2
Browse files Browse the repository at this point in the history
Run actionlint as a pre-merge check.
  • Loading branch information
sengi authored Jul 8, 2024
2 parents 78baec4 + 3702c10 commit da1e938
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint GitHub Actions
on:
push:
paths: ['.github/**']
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: alphagov/govuk-infrastructure/.github/actions/actionlint@main
14 changes: 9 additions & 5 deletions .github/workflows/build-multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
show-progress: false
- id: set-matrix
run: |
echo "matrix=$(jq -c . < build-matrix.json)" >> $GITHUB_OUTPUT
echo "matrix_versions=$(jq -c .version < build-matrix.json)" >> $GITHUB_OUTPUT
echo "runs_on=$(jq -c .runs_on < build-matrix.json)" >> $GITHUB_OUTPUT
{
echo "matrix=$(jq -c . < build-matrix.json)"
echo "matrix_versions=$(jq -c .version < build-matrix.json)"
echo "runs_on=$(jq -c .runs_on < build-matrix.json)"
} >> "$GITHUB_OUTPUT"
build_and_push_image:
name: Build ruby_${{ join(matrix.version.rubyver, '.') }} for ${{ matrix.runs_on.arch }} and push to GHCR
Expand Down Expand Up @@ -67,7 +69,7 @@ jobs:
id: calculate-image-tags
run: |
CREATED_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
echo "createdDate=${CREATED_DATE}" >> $GITHUB_OUTPUT
echo "createdDate=${CREATED_DATE}" >> "$GITHUB_OUTPUT"
- name: Generate Base Image Metadata
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -190,7 +192,7 @@ jobs:
id: calculate-image-tags
run: |
CREATED_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
echo "createdDate=${CREATED_DATE}" >> $GITHUB_OUTPUT
echo "createdDate=${CREATED_DATE}" >> "$GITHUB_OUTPUT"
- name: Login to GHCR
uses: docker/login-action@v3
Expand Down Expand Up @@ -224,6 +226,7 @@ jobs:
- name: Create Manifest Lists (for Base)
working-directory: /tmp/digests/base
run: |
# shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_BASE }}/govuk-ruby-base@sha256:%s ' *)
Expand Down Expand Up @@ -252,6 +255,7 @@ jobs:
- name: Create Manifest Lists (for Builder)
working-directory: /tmp/digests/builder
run: |
# shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_BASE }}/govuk-ruby-builder@sha256:%s ' *)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
jq <build-matrix.json -cr '[.version[].rubyver[:2] | join("\\.")] | join("|")'
))(-.*)?|$(
jq <build-matrix.json -cr '[.version[].extra | select(length > 0)] | join("|")'
))\$" >> $GITHUB_OUTPUT
))\$" >> "$GITHUB_OUTPUT"
gc_old_images:
name: GC old images
Expand Down

0 comments on commit da1e938

Please sign in to comment.