2022-07-26 16:24:27 +03:00
|
|
|
name: buildx
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2022-07-26 20:09:43 +03:00
|
|
|
- cron: "37 06 * * 1"
|
2022-07-26 16:24:27 +03:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildx:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
docker-file:
|
|
|
|
- path: 1.16
|
|
|
|
tags: "1.16"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-07-26 16:24:27 +03:00
|
|
|
- path: 1.16-3.13
|
|
|
|
tags: "1.16-3.13"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-07-26 16:24:27 +03:00
|
|
|
- path: 1.17
|
|
|
|
tags: "1.17"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-07-26 16:24:27 +03:00
|
|
|
- path: 1.17-3.13
|
|
|
|
tags: "1.17-3.13"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-07-26 16:24:27 +03:00
|
|
|
- path: 1.18
|
|
|
|
tags: "1.18"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-10-28 16:07:33 +03:00
|
|
|
- path: 1.18-nofaccessat2
|
|
|
|
tags: "1.18-nofaccessat2"
|
2022-07-26 19:39:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-08-05 16:36:10 +03:00
|
|
|
- path: 1.19
|
|
|
|
tags: "1.19"
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-08-12 13:28:42 +03:00
|
|
|
- path: 1.19-nofaccessat2
|
|
|
|
tags: "1.19-nofaccessat2"
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2023-08-09 15:44:18 +03:00
|
|
|
- path: "1.20"
|
2023-08-09 15:42:03 +03:00
|
|
|
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
|
2024-02-14 09:42:54 +03:00
|
|
|
- path: 1.22
|
|
|
|
tags: "1.22"
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
|
|
|
- path: 1.22-nofaccessat2
|
|
|
|
tags: "1.22-nofaccessat2"
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/386
|
2022-07-26 16:24:27 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-04 22:24:01 +03:00
|
|
|
uses: actions/checkout@v4
|
2022-07-26 16:24:27 +03:00
|
|
|
|
|
|
|
- name: Prepare
|
|
|
|
id: prepare
|
|
|
|
run: |
|
2022-07-26 19:39:53 +03:00
|
|
|
DOCKER_IMAGE=neur0toxine/golang-alpine
|
2022-07-26 16:24:27 +03:00
|
|
|
|
|
|
|
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
|
2023-09-12 22:27:51 +03:00
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
2022-07-26 16:24:27 +03:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2024-04-08 22:54:07 +03:00
|
|
|
uses: docker/setup-buildx-action@v3.3.0
|
2022-07-26 16:24:27 +03:00
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
|
|
|
|
- name: Available platforms
|
|
|
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
|
|
|
|
|
|
- name: Docker Buildx (build)
|
2024-06-21 22:43:27 +03:00
|
|
|
uses: docker/build-push-action@v6.1.0
|
2022-07-26 16:24:27 +03:00
|
|
|
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')
|
2024-07-22 22:49:22 +03:00
|
|
|
uses: docker/login-action@v3.3.0
|
2022-07-26 16:24:27 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Docker Buildx (push)
|
2024-06-21 22:43:27 +03:00
|
|
|
uses: docker/build-push-action@v6.1.0
|
2022-07-26 16:24:27 +03:00
|
|
|
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
|