From 6d28c186cdfbd0d51b7034edd4089af3284abcd0 Mon Sep 17 00:00:00 2001 From: Vinicius Schettino Date: Wed, 9 Dec 2020 18:48:55 -0300 Subject: [PATCH] use buildx + docker login no workflow --- .github/workflows/release.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ebf9b0..0b0ac7b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,21 +21,21 @@ jobs: draft: false prerelease: false docker_push: - name: Push image to docker registry + name: Push image Docker Hub runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v1 + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker Build - run: docker build -t passeidireto/trigger-external-workflow-action . - - name: Docker Tag - run: | - docker tag passeidireto/trigger-external-workflow-action passeidireto/trigger-external-workflow-action:latest - docker tag passeidireto/trigger-external-workflow-action passeidireto/trigger-external-workflow-action:${GITHUB_REF/refs\/tags\/v/} - - name: Docker Push - run: docker push passeidireto/trigger-external-workflow-action + - name: Find Git Tag + run: echo "TAG=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV + - name: Docker Build and Push + uses: docker/build-push-action@v2 + with: + push: true + tags: | + passeidireto/trigger-external-workflow-action:latest + passeidireto/trigger-external-workflow-action:${{ env.TAG }}