-
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.
Browse files
Browse the repository at this point in the history
[Feat] CI/CD
- Loading branch information
Showing
2 changed files
with
65 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,46 @@ | ||
name: server | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Ensure resource directory exists | ||
run: mkdir -p ./src/main/resources | ||
|
||
- name : injection-yml | ||
run : echo -E "${{ secrets.YML }}" > ./src/main/resources/application.yml | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Execute Gradle build and analyze | ||
run: ./gradlew jib | ||
|
||
- name: Run scripts in server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ${{ secrets.USERNAME }} | ||
script: ${{ secrets.SCRIPT }} |
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