-
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.
Merge pull request #2 from fodo-developers/1-ci-ktlint
CI Ktlint 추가
- Loading branch information
Showing
3 changed files
with
71 additions
and
52 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 |
---|---|---|
@@ -1,30 +1,35 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
workflow_run: | ||
workflows: ["Gradle CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: excuting remote ssh commands | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.REMOTE_IP }} | ||
port: ${{ secrets.REMOTE_SSH_PORT }} | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.REMOTE_KEY }} | ||
script: | | ||
cd /home/ubuntu/prisism-backend | ||
git pull origin main | ||
./gradlew clean | ||
./gradlew build | ||
docker build -t prisism/backend . | ||
docker stop prisism-backend || true | ||
docker rm prisism-backend || true | ||
docker run -d -it --env-file ./.env -p 8080:8080 --name prisism-backend prisism/backend | ||
- name: excuting remote ssh commands | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.REMOTE_IP }} | ||
port: ${{ secrets.REMOTE_SSH_PORT }} | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.REMOTE_KEY }} | ||
script: | | ||
cd /home/ubuntu/prisism-backend | ||
git pull origin main | ||
./gradlew clean | ||
./gradlew build | ||
docker build -t prisism/backend . | ||
docker stop prisism-backend || true | ||
docker rm prisism-backend || true | ||
docker run -d -it --env-file ./.env -p 8080:8080 --name prisism-backend prisism/backend |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
name: Gradle CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 | ||
|
||
- name: Build with Gradle Wrapper | ||
run: ./gradlew build | ||
|
||
ktlint: | ||
name: Check Code Quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: ktlint | ||
uses: ScaCap/action-ktlint@master | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
reporter: github-pr-review | ||
|