diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4f845a7..9487f76 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -38,9 +38,9 @@ jobs: - name: Docker build & push if: github.ref == 'refs/heads/main' # 메인 브랜치에 푸시했을 때만 실행 run: | - docker login -u ${{ secrets.DOCKERHUB_NAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} - docker build -t ${{ secrets.DOCKERHUB_NAME}}/${{ secrets.DOCKERHUB_REPOSITORY}} ./ - docker push ${{ secrets.DOCKERHUB_NAME }}/${{ secrets.DOCKERHUB_REPOSITORY}} + echo $DOCKERHUB_TOKEN | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest ./ + docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest # EC2로 배포 - name: Deploy to EC2 if: github.ref == 'refs/heads/main' # 메인 브랜치에 푸시했을 때만 실행