buildx #1916
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: buildx | |
on: | |
schedule: | |
- cron: "17 15 * * *" | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
buildx: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
with: | |
install: true | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Docker Buildx (build) | |
uses: docker/[email protected] | |
if: success() && !contains(github.ref, 'master') | |
with: | |
push: false | |
build-args: REFRESHED_AT=$(date +%Y-%m-%d) | |
platforms: linux/amd64 | |
tags: timbru31/alpine-java-maven:latest | |
- name: Docker Login | |
if: success() && contains(github.ref, 'master') | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker Buildx (push) | |
uses: docker/[email protected] | |
if: success() && contains(github.ref, 'master') | |
with: | |
push: true | |
build-args: REFRESHED_AT=$(date +%Y-%m-%d) | |
platforms: linux/amd64 | |
tags: timbru31/alpine-java-maven:latest | |
- name: Inspect Image | |
if: always() && github.event_name != 'pull_request' && contains(github.ref, 'master') | |
run: | | |
docker buildx imagetools inspect timbru31/alpine-java-maven:latest | |
- name: Clear | |
if: always() && github.event_name != 'pull_request' | |
run: | | |
rm -f ${HOME}/.docker/config.json |