-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [feat] #110 create Dockerfile-prod * [feat] #110 create prod-ci and prod-cd * [feat] #110 add discord webhook prod version * [feat] #110 update server_yml
- Loading branch information
Showing
5 changed files
with
103 additions
and
1 deletion.
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,62 @@ | ||
name: prod-CD | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
working-directory: . | ||
|
||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
token: ${{ secrets.SUBMODULE_TOKEN }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
|
||
- name: build | ||
run: | | ||
chmod +x gradlew | ||
./gradlew build -x test | ||
shell: bash | ||
|
||
- name: docker login | ||
uses: docker/[email protected] | ||
|
||
- name: login docker hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_LOGIN_USERNAME }} | ||
password: ${{ secrets.DOCKER_LOGIN_ACCESSTOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile-prod | ||
push: true | ||
tags: ${{ secrets.DOCKER_LOGIN_USERNAME }}/${{ secrets.PROD_REPONAME }} | ||
|
||
cd: | ||
needs: ci | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: docker container run | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.PROD_SERVER_IP }} | ||
username: ${{ secrets.PROD_SERVER_USER }} | ||
key: ${{ secrets.PROD_SERVER_KEY }} | ||
script: | | ||
cd ~ | ||
./deploy.sh |
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,28 @@ | ||
name: prod-CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
token: ${{ secrets.SUBMODULE_TOKEN }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
|
||
- name: build | ||
run: | | ||
chmod +x gradlew | ||
./gradlew build -x test | ||
shell: bash |
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,4 @@ | ||
FROM amd64/amazoncorretto:17 | ||
WORKDIR /app | ||
COPY ./build/libs/server-0.0.1-SNAPSHOT.jar /app/KKUM-SERVER.jar | ||
CMD ["java", "-Duser.timezone=Asia/Seoul", "-jar", "-Dspring.profiles.active=prod", "KKUM-SERVER.jar"] |
Submodule SERVER_YML
updated
from 4bff15 to 81fc14
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