Skip to content

Commit

Permalink
[Weekly/10/Chore/Deploy] push일 때만 Deploy되도록 수정 (#83)
Browse files Browse the repository at this point in the history
* chore: push일 때만 Deploy되도록 수정

* chore: push일 때만 Docker push 되도록 수정
  • Loading branch information
lja3723 committed Nov 8, 2024
1 parent 3ce3264 commit 666c644
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,25 @@ jobs:
./gradlew clean build -x test
- name: Docker Hub Login
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker Build
if: github.event_name == 'push'
run: docker build -f Dockerfile --build-arg DEPENDENCY=build/dependency -t ${{ secrets.DOCKER_REPO_FULLNAME }} .

- name: Docker Push
if: github.event_name == 'push'
run: docker push ${{ secrets.DOCKER_REPO_FULLNAME }}

## 2단계: 서버에 배포
Deploy:
runs-on: ubuntu-22.04
needs: Build
if: github.event_name == 'push'
steps:
- name: Pull New Docker Image
uses: appleboy/ssh-action@master
Expand Down

0 comments on commit 666c644

Please sign in to comment.