-
Notifications
You must be signed in to change notification settings - Fork 1
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 #16 from gaaji/GM-176
GM-176 GithubAction CI 설정파일, Dockerfile 생성
- Loading branch information
Showing
3 changed files
with
112 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,30 @@ | ||
# Issue# - Issue | ||
## Description | ||
> | ||
## PR Type | ||
- [ ] Hotfix | ||
- [ ] Feature | ||
- [ ] Code style update | ||
- [ ] Refactor (code, package, etc.) | ||
- [ ] Build (gradle, spring, etc) | ||
- [ ] Documentation content changes (api docs, etc.) | ||
- [ ] Infra (cloud, security, etc.) | ||
- [ ] Other... Please describe : | ||
|
||
## Related Issues | ||
- | ||
|
||
## Issues | ||
|
||
### Test | ||
|
||
*** | ||
|
||
## Related Files | ||
- `file` | ||
|
||
## Think About.. | ||
|
||
## Conclusion | ||
> |
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,77 @@ | ||
|
||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
pull_request: | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
DOCKER_IMAGE: ghcr.io/${{ github.actor }}/gaaji-auth-service | ||
VERSION: ${{ github.sha }} | ||
|
||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Create secret.yml | ||
env: | ||
SECRET_CODE: ${{ secrets.SECRET }} | ||
SECRET_DIR: src/main/resources | ||
SECRET_FILE_NAME: secret.yml | ||
run: echo $SECRET_CODE | base64 --decode > $SECRET_DIR/$SECRET_FILE_NAME | ||
|
||
- name: Create application-oauth.yml | ||
env: | ||
SECRET_CODE: ${{ secrets.OAUTH }} | ||
SECRET_DIR: src/main/resources | ||
SECRET_FILE_NAME: application-oauth.yml | ||
run: echo $SECRET_CODE | base64 --decode > $SECRET_DIR/$SECRET_FILE_NAME | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name : Set Eureka Server | ||
run: | | ||
docker pull ${{ secrets.EUREKA }} | ||
docker run -d -p 8761:8761 ${{ secrets.EUREKA }} | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | ||
with: | ||
arguments: build | ||
|
||
- name: Set up docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to ghcr | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
|
||
- name: show directory | ||
run: ls | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . # dockerfile이 있는 위치랑 맞춰주자 | ||
file: ./Dockerfile # 빌드할 Dockerfile이 있는 디렉토리 | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE }}:local |
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,5 @@ | ||
FROM openjdk:17-alpine | ||
VOLUME /tmp | ||
COPY build/libs/auth-0.0.1-SNAPSHOT.jar api.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java","-jar", "api.jar"] |