Skip to content

Commit

Permalink
[feat] gradle chaching 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJE20 authored Sep 23, 2023
1 parent 01e2c47 commit 8781770
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,33 @@ jobs:
- name: 저장소 Checkout
uses: actions/checkout@v3

- name: 스프링부트 애플리케이션 빌드 # (1)
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*',
'**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 스프링부트 애플리케이션 빌드
run: sudo ./gradlew build

- name: 도커 이미지 빌드 # (2)
- name: 도커 이미지 빌드
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest .

- name: Docker Hub 로그인 # (3)
- name: Docker Hub 로그인
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker Hub 퍼블리시 # (4)
- name: Docker Hub 퍼블리시
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest

- name: WAS 인스턴스 접속 및 애플리케이션 실행 # (5)
- name: WAS 인스턴스 접속 및 애플리케이션 실행
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_SSH_HOST }}
Expand Down

0 comments on commit 8781770

Please sign in to comment.