From 02fdc0219703366f3ae84d3dc4ba0b2a0a385caf Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 28 Dec 2020 20:33:31 +0100 Subject: [PATCH] Updated GitHub Action Enable conditional push to Docker Hub (only for release tags) Enable Dependabot --- .github/dependabot.yml | 7 +++++++ .github/workflows/docker-image.yml | 31 +++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..583decf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 266031e..752356f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,17 +1,33 @@ -name: Docker Image CI +name: Docker Multi-Arch Build & Push on: push: - branches: [master] + branches: + - 'master' + tags: + - '[1-9]+.[0-9]+' pull_request: - branches: [master] + branches: jobs: buildx: runs-on: ubuntu-latest steps: + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Checkout uses: actions/checkout@v2 + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGENAME }} + tag-semver: | + {{version}} + {{major}}. {{minor}} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -19,3 +35,12 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./INSTALL.d/Dockerfile + platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x + push: ${{ github.event_name != 'pull_request' && steps.docker_meta.outputs.version != 'master' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} \ No newline at end of file