feat: 장소 거리 데이터 cache 적용 #189
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: CI - Pull request | |
on: | |
issue_comment: | |
types: [ created ] | |
jobs: | |
build: | |
name: ready for launch (CI) | |
runs-on: ubuntu-latest | |
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '출격준비')}} | |
steps: | |
- name: Get PR branch | |
id: get_branch | |
run: | | |
PR_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH") | |
BRANCH_NAME=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \ | |
jq -r .head.ref) | |
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT | |
- name: Repository 접근 | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.get_branch.outputs.branch }} | |
- name: JDK 21 셋팅 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Gradle 의존성 캐싱 | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: ktlint check | |
run: ./gradlew ktlintCheck | |
- name: 프로젝트 빌드 | |
env: | |
SECRET_MANAGER_TOKEN: ${{ secrets.SECRET_MANAGER_TOKEN }} | |
SECRET_MANAGER_WORKSPACE: ${{ secrets.SECRET_MANAGER_WORKSPACE }} | |
CURRENT_GIT_SHA: ${{ github.sha }} | |
STATUS: PR | |
run: ./gradlew build | |
- name: Set build status output | |
id: set_status | |
run: echo "build_status=${{ job.status }}" >> $GITHUB_OUTPUT | |
- name: Comment on Pull Request | |
if: always() | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const status = '${{ steps.set_status.outputs.build_status }}'; | |
const message = status === 'success' ? '✅ 빌드 성공 ✅\n🚀 출격 준비 완료 👨🏻🚀' : '❌❌ 빌드 실패 ❌❌\n😵😵💫 코드 확인이 필요해요 😵😵💫'; | |
github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body: `${message}` | |
}); |