2020-06-07 01:53:23 +03:00
|
|
|
name: buildx
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2020-10-08 12:59:45 +03:00
|
|
|
- cron: "37 06 * * *"
|
2020-06-07 01:53:23 +03:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildx:
|
2020-12-14 14:30:17 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2020-06-07 01:53:23 +03:00
|
|
|
strategy:
|
2020-11-04 18:11:01 +03:00
|
|
|
fail-fast: false
|
2020-06-07 01:53:23 +03:00
|
|
|
matrix:
|
|
|
|
docker-file:
|
2020-10-08 12:59:45 +03:00
|
|
|
- path: 12
|
2020-12-14 14:30:17 +03:00
|
|
|
tags: "12 erbium"
|
2020-10-28 19:32:58 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
|
|
|
- path: 14
|
2021-10-29 17:13:48 +03:00
|
|
|
tags: "14 fermium"
|
2020-10-09 10:53:51 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
2021-08-10 13:04:14 +03:00
|
|
|
- path: 16
|
2021-10-29 17:13:48 +03:00
|
|
|
tags: "16 gallium latest"
|
2021-08-21 00:52:26 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm/v6
|
2021-08-10 13:04:14 +03:00
|
|
|
|
2020-06-07 01:53:23 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2021-11-03 13:01:16 +03:00
|
|
|
uses: actions/checkout@v2.4.0
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Prepare
|
|
|
|
id: prepare
|
|
|
|
run: |
|
|
|
|
DOCKER_IMAGE=timbru31/node-alpine-git
|
|
|
|
|
2020-12-14 14:30:17 +03:00
|
|
|
TEMP="${{ matrix.docker-file.tags }}"
|
|
|
|
TAGZ=($TEMP)
|
2020-06-07 01:53:23 +03:00
|
|
|
VERSION=${TAGZ[0]}
|
|
|
|
|
2020-12-14 14:30:17 +03:00
|
|
|
for i in "${!TAGZ[@]}"; do
|
|
|
|
if [ "$i" -eq "0" ];
|
|
|
|
then
|
|
|
|
TAGS="${DOCKER_IMAGE}:${TAGZ[$i]}"
|
|
|
|
else
|
|
|
|
TAGS="${TAGS},${DOCKER_IMAGE}:${TAGZ[$i]}"
|
|
|
|
fi
|
2020-06-07 01:53:23 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
|
|
|
echo ::set-output name=version::${VERSION}
|
2020-10-08 12:59:45 +03:00
|
|
|
echo ::set-output name=tags::${TAGS}
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2021-05-27 19:46:08 +03:00
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2021-09-06 11:39:09 +03:00
|
|
|
uses: docker/setup-buildx-action@v1.6.0
|
2020-10-05 14:13:24 +03:00
|
|
|
with:
|
2020-10-08 12:59:45 +03:00
|
|
|
install: true
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Available platforms
|
|
|
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
|
|
|
|
|
|
- name: Docker Buildx (build)
|
2022-01-19 13:43:02 +03:00
|
|
|
uses: docker/build-push-action@v2.8.0
|
2020-10-08 12:59:45 +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 }}
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Docker Login
|
2020-10-08 12:59:45 +03:00
|
|
|
if: success() && contains(github.ref, 'master')
|
2021-12-21 11:36:55 +03:00
|
|
|
uses: docker/login-action@v1.12.0
|
2020-10-08 12:59:45 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Docker Buildx (push)
|
2022-01-19 13:43:02 +03:00
|
|
|
uses: docker/build-push-action@v2.8.0
|
2020-10-08 12:59:45 +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 }}
|
2020-06-07 01:53:23 +03:00
|
|
|
|
2020-12-14 11:58:55 +03:00
|
|
|
- name: Inspect Image
|
|
|
|
if: always() && github.event_name != 'pull_request' && contains(github.ref, 'master')
|
2020-06-07 01:53:23 +03:00
|
|
|
run: |
|
2020-12-14 11:58:55 +03:00
|
|
|
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
2020-06-07 01:53:23 +03:00
|
|
|
|
|
|
|
- name: Clear
|
|
|
|
if: always() && github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
rm -f ${HOME}/.docker/config.json
|