Skip to content

Commit

Permalink
chore: update gradle.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Jul 3, 2024
1 parent 2830e9e commit 6a33078
Showing 1 changed file with 35 additions and 27 deletions.
62 changes: 35 additions & 27 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,48 @@ jobs:
with:
arguments: clean build -x test

## 아티팩트 업로드
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: build/libs/ # Gradle 빌드 결과물 경로

# Docker Push
docker_push:
runs-on: ubuntu-latest
needs: build # This ensures the build job runs before this job

steps:
## 체크아웃 (필요한 경우)
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.TOKEN }}
submodules: true

## 아티팩트 다운로드
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: build/libs

## Docker build & push
- name: Docker build and push
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
docker build -t ${{ secrets.DOCKERHUB_REPOSITORY }} .
docker tag ${{ secrets.DOCKERHUB_REPOSITORY }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
#
# ## 아티팩트 업로드
# - name: Upload build artifacts
# uses: actions/upload-artifact@v3
# with:
# name: build-artifacts
# path: build/libs/ # Gradle 빌드 결과물 경로
#
# # Docker Push
# docker_push:
# runs-on: ubuntu-latest
# needs: build # This ensures the build job runs before this job
#
# steps:
# ## 체크아웃 (필요한 경우)
# - name: Checkout
# uses: actions/checkout@v3
# with:
# token: ${{ secrets.TOKEN }}
# submodules: true
#
# ## 아티팩트 다운로드
# - name: Download build artifacts
# uses: actions/download-artifact@v3
# with:
# name: build-artifacts
# path: build/libs
#
# ## Docker build & push
# - name: Docker build and push
# run: |
# docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
# docker build -t ${{ secrets.DOCKERHUB_REPOSITORY }} .
# docker tag ${{ secrets.DOCKERHUB_REPOSITORY }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
# docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}

# Deploy
deploy:
Expand Down

0 comments on commit 6a33078

Please sign in to comment.