Skip to content

Commit

Permalink
refactor : github action yml
Browse files Browse the repository at this point in the history
  • Loading branch information
NameIsUser06 committed Dec 18, 2023
1 parent d837ebf commit 227d2bb
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Java CI with Gradle

# master 브랜치에 push, PR 이벤트 발생시 동작.
on:
push:
branches: [ "develop" ]
Expand All @@ -21,26 +20,33 @@ jobs:
distribution: 'adopt'
java-version: '17'

- name: permission
- name: Permission
run: chmod +x ./gradlew

# Spring Boot 어플리케이션 Build (1)
- name: Spring Boot Build
run: ./gradlew clean build --exclude-task test

# Docker 이미지 Build (2)
- name: docker image build
run: docker build -t woosoungcho/findfriend:latest .

# DockerHub Login (3)
- name: docker login
- name: Docker Image Build
run: docker buildx create --use && docker buildx inspect --bootstrap
if: runner.os == 'Linux'

- name: Build ARM Docker Image
run: |
docker buildx create --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/arm64 -t woosoungcho/findfriend:latest .
if: runner.os == 'Linux'

- name: DockerHub Login (3)
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Docker Hub push (4)
- name: docker Hub push
- name: Docker Hub Push
run: docker push woosoungcho/findfriend:latest

- name: Connect to WAS & Execute Application
Expand All @@ -54,4 +60,4 @@ jobs:
cd ~/findfriend
docker-compose down
docker-compose pull
docker-compose up -d
docker-compose up -d

0 comments on commit 227d2bb

Please sign in to comment.