Skip to content

Commit

Permalink
Fix: docker tag using commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jokj624 committed Dec 4, 2023
1 parent 61ad9f9 commit 3e553b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/develop_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3e553b4

Please sign in to comment.