Skip to content

Bump docker/build-push-action from 5 to 6 #112

Bump docker/build-push-action from 5 to 6

Bump docker/build-push-action from 5 to 6 #112

Workflow file for this run

# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: dev
on:
push:
branches:
- master
tags-ignore:
- "*"
paths-ignore:
- README.md
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ctx: v1
version: "1.33.12"
- ctx: v2
version: "2.16.12"
env:
BUILD_PLATFORMS: linux/amd64,linux/arm64
DOCKER_VERSION: "24.0.7"
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v5
# https://github.com/docker/metadata-action
with:
images: |
localhost:5000/cheyilin/docker-awscli
tags: |
type=raw,value=${{ matrix.ctx }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.BUILD_PLATFORMS }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build and Push
uses: docker/build-push-action@v6
# https://github.com/docker/build-push-action
with:
context: ${{ matrix.ctx }}
platforms: ${{ env.BUILD_PLATFORMS }}
build-args: |
DOCKER_VERSION=${{ env.DOCKER_VERSION }}
AWS_CLI_VERSION=${{ matrix.version }}
push: true
cache-from: type=gha,scope=${{ matrix.ctx }}
cache-to: type=gha,scope=${{ matrix.ctx }},mode=max
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ steps.meta.outputs.tags }}
- name: Inspect Image
run: |
docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
- name: Test Preflight
run: |
docker network create dind
docker run -d --privileged \
--network=dind --network-alias=docker -e DOCKER_TLS_CERTDIR= docker:${{ env.DOCKER_VERSION }}-dind \
--tls=false --registry-mirror=https://mirror.gcr.io
docker run --network=dind praqma/network-multitool \
sh -c 'until curl -sf http://docker:2375/_ping; do echo "* Wait for dockerd to be ready ..."; sleep 1; done'
- name: Test (linux/amd64)
run: |
CMD="docker run --platform=linux/amd64 --network=dind ${{ steps.meta.outputs.tags }}"
${CMD} docker version
${CMD} aws --version
- name: Test (linux/arm64)
run: |
CMD="docker run --platform=linux/arm64 --network=dind ${{ steps.meta.outputs.tags }}"
${CMD} docker version
${CMD} aws --version
- name: Comment
if: ${{ github.actor != 'dependabot[bot]' }}
uses: peter-evans/commit-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Pipeline has passed. :tada:
- context: `${{ matrix.ctx }}`
- version: `${{ matrix.version }}`