Skip to content

Commit

Permalink
fix: docker login 방식 변경 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdtkdgns committed Nov 20, 2023
1 parent a2c4e6d commit 5f6cffc
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_IMAGE_NAME: ${{ secrets.DOCKERHUB_IMAGE_NAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
TEST: ${{ secrets.TEST }}
TEST2: 2222222

permissions:
contents: read
Expand All @@ -35,7 +33,7 @@ jobs:
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew | echo $TEST ${{ secrets.TEST }} $TEST2
run: chmod +x ./gradlew


- name: Build with Gradle
Expand All @@ -47,18 +45,25 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD

- name: Docker Build and push
uses: docker/build-push-action@v3
with:
context: ./
push: true
tags: $DOCKERHUB_USERNAME/$DOCKERHUB_IMAGE_NAME:${{env.IMAGE_TAG}}
- name: Docker build and push
run: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker build -t $DOCKERHUB_USERNAME/$DOCKERHUB_IMAGE_NAME .
docker push $DOCKERHUB_USERNAME/$DOCKERHUB_IMAGE_NAME:${{env.IMAGE_TAG}}
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: $DOCKERHUB_USERNAME
# password: $DOCKERHUB_PASSWORD
#
# - name: Docker Build and push
# uses: docker/build-push-action@v3
# with:
# context: ./
# push: true
# tags: $DOCKERHUB_USERNAME/$DOCKERHUB_IMAGE_NAME:${{env.IMAGE_TAG}}

deploy:
needs: build_and_push
Expand Down

0 comments on commit 5f6cffc

Please sign in to comment.