Skip to content

Commit

Permalink
[BE] pr을 보낼 때는 CI를 수행하고, 성공적으로 merge가 될 때 CD까지 수행한다. (#98) (#103)
Browse files Browse the repository at this point in the history
* feat: pr 체크용 workflows 구현

* refactor: 브랜치명 수정

* feat: push 전용 workflows 구현

* Update pr_checker.yml

* Update pr_checker.yml

* Update pr_checker.yml

* Update push_builder.yml
  • Loading branch information
pjy1368 authored and Sehwan-Jang committed Aug 9, 2021
1 parent 768ba13 commit c87c77a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pr_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Darass PR Checker

on:
pull_request:
branches: [ develop/be ]

jobs:
build:

runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.MY_REPO_PAT }}
submodules: recursive

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: ./backend

- name: Build with Gradle
run: ./gradlew clean build
working-directory: ./backend

- name: build result to slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo, message, commit, author, action, eventName, ref, workflow, job, took
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle
name: Darass Push Builder

on:
push:
branches: [ develop/be ]
pull_request:
branches: [ develop/be ]

jobs:
build:
Expand All @@ -34,7 +32,7 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean build
working-directory: ./backend

- name: Copy built project
if: success()
uses: appleboy/scp-action@master
Expand Down Expand Up @@ -67,7 +65,7 @@ jobs:
mv workspace 2021-darass
cd 2021-darass/backend
docker-compose up --build -d
- name: build result to slack
uses: 8398a7/action-slack@v3
with:
Expand Down

0 comments on commit c87c77a

Please sign in to comment.