From 6cc86419097357eb5296ded138a8de5ef8ec4db4 Mon Sep 17 00:00:00 2001 From: Anton Pates Date: Fri, 18 Aug 2023 15:43:09 +0000 Subject: [PATCH] add a tag for a docker image --- .github/workflows/docker-image.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bca1d90..8ee05fa 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,9 +14,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag ghcr.io/g-core/cert-manager-webhook-gcore:latest - - name: Login to registry uses: docker/login-action@v2 with: @@ -24,5 +21,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Push the Docker image - run: docker push ghcr.io/g-core/cert-manager-webhook-gcore:latest + - name: Build and push + id: docker_build + uses: docker/build-push-action@v4 + with: + push: true + context: . + file: ./Dockerfile + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ github.ref }} \ No newline at end of file