Skip to content

Commit

Permalink
Merge pull request #2 from fodo-developers/1-ci-ktlint
Browse files Browse the repository at this point in the history
CI Ktlint 추가
  • Loading branch information
enbraining authored Jun 28, 2024
2 parents 928b9c8 + 0701262 commit adecd87
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 52 deletions.
53 changes: 29 additions & 24 deletions .github/workflows/aws_cd.yml
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
28 changes: 0 additions & 28 deletions .github/workflows/gradle.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/gradle_ci.yml
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

0 comments on commit adecd87

Please sign in to comment.