From 007cd99df77e76a8149c3c5ddc4e32808bddde6c Mon Sep 17 00:00:00 2001 From: Genar Trias Ortiz Date: Thu, 6 May 2021 15:52:10 +0200 Subject: [PATCH] better docker images tagging --- .github/workflows/docker.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f9ad876..2947f6e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,10 +11,23 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v2 - - name: Push to Docker Hub - uses: docker/build-push-action@v1 + - name: Docker meta + id: meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + # list of Docker images to use as base name for tags + images: | + factorialco/tentaclesql + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - repository: factorialco/tentaclesql - tag_with_ref: true + - name: Push to Docker Hub + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}