From 3e553b409ba7ac60e1663d9bc7a5614d01226075 Mon Sep 17 00:00:00 2001 From: jokj624 Date: Mon, 4 Dec 2023 22:44:46 +0900 Subject: [PATCH] Fix: docker tag using commit hash --- .github/workflows/develop_test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/develop_test.yml b/.github/workflows/develop_test.yml index 7bf5b5e..f1d31b7 100644 --- a/.github/workflows/develop_test.yml +++ b/.github/workflows/develop_test.yml @@ -59,13 +59,14 @@ jobs: NAME: ${{secrets.DOCKER_HUB_USERNAME}} REPO: havit-push run: | + shortHash=$(git rev-parse --short ${{ github.sha }}) docker build -t $REPO -f Dockerfile.dev . docker tag $REPO:latest $NAME/$REPO:latest docker tag $REPO:latest $NAME/$REPO:dev - # docker tag $REPO:latest $NAME/$REPO:${{steps.current-time.outputs.formattedTime}} + docker tag $REPO:latest $NAME/$REPO:dev-$shortHash docker push $NAME/$REPO:latest docker push $NAME/$REPO:dev - # docker push $NAME/$REPO:${{steps.current-time.outputs.formattedTime}} + docker push $NAME/$REPO:dev-$shortHash - name: Run Deploy Script uses: appleboy/ssh-action@master @@ -76,7 +77,7 @@ jobs: port: ${{ secrets.REMOTE_SSH_PORT }} script: | sudo su - bash /opt/havit/docker/deploy-dev.sh + /opt/havit/docker/deploy.sh dev - name: action-slack uses: 8398a7/action-slack@v3