중복된 동아리 이름 검증 #130 #45
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
name: crews backend development version distribute | |
on: | |
push: | |
branches: [ "dev" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.ACTION_TOKEN }} | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }}- | |
- name: Set up MySQL | |
uses: mirromutth/[email protected] | |
with: | |
mysql database: 'crews' | |
mysql user: ${{ secrets.TEST_DB_USERNAME }} | |
mysql password: ${{ secrets.TEST_DB_PASSWORD }} | |
- name: Set up Redis And Redis Stack | |
uses: hoverkraft-tech/[email protected] | |
with: | |
compose-file: "./docker-compose-local.yml" | |
- name: Run Test And Create API Documentation | |
run: ./gradlew openapi3 | |
- name: Build with Gradle | |
run: ./gradlew bootJar -x test | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build Docker Image And Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKER_SERVER_IMAGE_NAME }} | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
alarm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract Commit Title | |
id: extract_commit_title | |
run: echo "COMMIT_TITLE=$(echo "${{ github.event.head_commit.message }}" | head -n 1)" >> $GITHUB_ENV | |
- name: Notify Slack on Success | |
if: success() | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "새로운 개발 서버 버전이 배포됐어요! \n ✅ 요약: ${{ env.COMMIT_TITLE }} \n ✅ 새 도커 이미지를 PULL 받아주세요" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEV }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |