docker-golang-alpine/.github/workflows/buildx.yml
dependabot[bot] 743c8c3536
Bump docker/build-push-action from 4.0.0 to 5.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 19:27:54 +00:00

129 lines
4.0 KiB
YAML

name: buildx
on:
schedule:
- cron: "37 06 * * 1"
pull_request:
push:
jobs:
buildx:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker-file:
- path: 1.16
tags: "1.16"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.16-3.13
tags: "1.16-3.13"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.17
tags: "1.17"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.17-3.13
tags: "1.17-3.13"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.18
tags: "1.18"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.18-nofaccessat2
tags: "1.18-nofaccessat2"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.19
tags: "1.19"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.19-nofaccessat2
tags: "1.19-nofaccessat2"
platforms: linux/amd64,linux/arm64,linux/386
- path: "1.20"
tags: "1.20"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.20-nofaccessat2
tags: "1.20-nofaccessat2"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.21
tags: "1.21"
platforms: linux/amd64,linux/arm64,linux/386
- path: 1.21-nofaccessat2
tags: "1.21-nofaccessat2"
platforms: linux/amd64,linux/arm64,linux/386
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare
id: prepare
run: |
DOCKER_IMAGE=neur0toxine/golang-alpine
TEMP="${{ matrix.docker-file.tags }}"
TAGZ=($TEMP)
VERSION=${TAGZ[0]}
for i in "${!TAGZ[@]}"; do
if [ "$i" -eq "0" ];
then
TAGS="${DOCKER_IMAGE}:${TAGZ[$i]}"
else
TAGS="${TAGS},${DOCKER_IMAGE}:${TAGZ[$i]}"
fi
done
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.6.0
with:
install: true
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Docker Buildx (build)
uses: docker/build-push-action@v5.0.0
if: success() && !contains(github.ref, 'master')
with:
push: false
context: ./${{ matrix.docker-file.path }}
file: ./${{ matrix.docker-file.path }}/Dockerfile
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
platforms: ${{ matrix.docker-file.platforms }}
tags: ${{ steps.prepare.outputs.tags }}
- name: Docker Login
if: success() && contains(github.ref, 'master')
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Buildx (push)
uses: docker/build-push-action@v5.0.0
if: success() && contains(github.ref, 'master')
with:
push: true
context: ./${{ matrix.docker-file.path }}
file: ./${{ matrix.docker-file.path }}/Dockerfile
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
platforms: ${{ matrix.docker-file.platforms }}
tags: ${{ steps.prepare.outputs.tags }}
- name: Inspect Image
if: always() && github.event_name != 'pull_request' && contains(github.ref, 'master')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
- name: Clear
if: always() && github.event_name != 'pull_request'
run: |
rm -f ${HOME}/.docker/config.json