diff --git a/.github/pull-request-workflow.yml b/.github/pull-request-workflow.yml new file mode 100644 index 00000000..320633fe --- /dev/null +++ b/.github/pull-request-workflow.yml @@ -0,0 +1,85 @@ +name: Bottles Pull Request Workflow + +on: + pull_request: + branches: + - develop + types: [ opened, reopened, synchronize ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + shell: bash + + - name: Build with gradle + run: ./gradlew clean build + shell: bash + + - name: Send Discord Notification + if: github.event.action == 'opened' || github.event.action == 'reopened' + env: + DATA: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*서버 PR* :bell: <@U07L8AX9B4N><@U07L87A3WKY>" + } + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Author:*\n" + }, + { + "type": "mrkdwn", + "text": "*Title:*\n${{ github.event.pull_request.title }}" + } + ] + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Description:*\n${{ github.event.pull_request.body }}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Pull Request URL:*\n<${{ github.event.pull_request.html_url }}|View PR>" + } + } + ] + } + run: | + curl -X POST -H 'Content-type: application/json' \ + -d "$DATA" \ + ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/test b/.github/test new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/.github/test @@ -0,0 +1 @@ +test