From 451081cdfdbc1af3ee9442db57383917a033474c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?s=E1=B4=A7=E1=B4=8D=E1=B4=9C=E1=B4=87=CA=9F=20=E1=B4=8D?= Date: Wed, 14 Feb 2024 00:03:33 +0000 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c0dbcd..62b3ba7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,8 +20,12 @@ jobs: - name: Build Docker image run: | - docker build -t sami/brudi-rclone:${{ github.ref }} . - docker tag sami/brudi-rclone:${{ github.ref }} sami/brudi-rclone:latest + if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then + DOCKER_TAG=latest + else + DOCKER_TAG=${{ github.ref }} + fi + docker build -t sami/brudi-rclone:${DOCKER_TAG} . - name: Log in to Docker Hub uses: docker/login-action@v1 @@ -31,5 +35,4 @@ jobs: - name: Push image to Docker Hub run: | - docker push sami/brudi-rclone:${{ github.ref }} - docker push sami/brudi-rclone:latest + docker push sami/brudi-rclone:${DOCKER_TAG}