From a00f1f219d064f66cd834e3efd58752486b17dd2 Mon Sep 17 00:00:00 2001 From: Jiwan Ahn Date: Mon, 2 Oct 2023 00:55:39 +0900 Subject: [PATCH] :construction_worker: fix: login in non TTY using echo --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1955d60..6171cff 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -49,7 +49,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} logout: true - - name: build and release to DockerHub + - name: Build and release to DockerHub run: | docker build -t ${{ secrets.PROJECT_NAME }} . docker tag ${{ secrets.PROJECT_NAME }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }}:latest @@ -71,7 +71,7 @@ jobs: key: ${{ secrets.EC2_KEY }} script: | - sudo docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin ${{ secrets.DOCKERHUB_TOKEN }} + echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin sudo docker kill ${{ secrets.PROJECT_NAME }} sudo docker rm -f ${{ secrets.PROJECT_NAME }} sudo docker rmi ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }}