-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from codestates-seb/dev-server#08/devops
[Feat] 백엔드 서버 CI 구현
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Java CI with Gradle | ||
|
||
on: | ||
pull_request: | ||
branches: [ dev-server, main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'zulu' | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Docker build | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKER_HUB_USERNAME }}/stockholm:${GITHUB_SHA::7} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# (1) base-image | ||
FROM openjdk:11 | ||
|
||
# (2) COPY에서 사용될 경로 변수 | ||
ARG JAR_FILE=build/libs/*-SNAPSHOT.jar | ||
|
||
# (3) jar 빌드 파일을 도커 컨테이너로 복사 | ||
COPY ${JAR_FILE} app.jar | ||
|
||
# (4) jar 파일 실행 | ||
ENTRYPOINT ["java","-jar","/app.jar"] |