fix: Activity API 삭제 (#2185) #12
This file contains hidden or 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: KOIN_API_V2 CD (develop) | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Record start time | |
| run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV | |
| - name: Notify Slack - Deploy Start | |
| env: | |
| ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%s HEAD) | |
| curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{ | |
| \"text\": \":rocket: *[Develop] 배포 시작*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• <${ACTIONS_URL}|Actions 보기>\" | |
| }" | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| cache-read-only: false | |
| cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} | |
| - name: Create Firebase Admin SDK JSON | |
| run: echo '${{ secrets.FCM_ADMIN_SDK_JSON_DEVELOP }}' > src/main/resources/koin-firebase-adminsdk.json | |
| - name: Build JAR | |
| run: | | |
| set -a | |
| source .env.example | |
| set +a | |
| ./gradlew clean build -x test -Dspring.profiles.active=dev | |
| - name: SCP JAR to develop server | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.DEVELOP_SERVER_HOST }} | |
| username: ${{ secrets.DEVELOP_SERVER_USER }} | |
| key: ${{ secrets.DEVELOP_SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.DEVELOP_SERVER_PORT }} | |
| source: ${{ secrets.SOURCE_JAR_PATH }} | |
| target: ${{ secrets.DEVELOP_SERVER_JAR_PATH }} | |
| strip_components: 2 | |
| - name: Run deploy script on develop server | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.DEVELOP_SERVER_HOST }} | |
| username: ${{ secrets.DEVELOP_SERVER_USER }} | |
| key: ${{ secrets.DEVELOP_SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.DEVELOP_SERVER_PORT }} | |
| script: ${{ secrets.DEVELOP_DEPLOY_SCRIPT_PATH }} | |
| - name: Notify Slack - Deploy Result | |
| if: always() | |
| env: | |
| ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%s HEAD) | |
| DURATION_SEC=$(( $(date +%s) - START_TIME )) | |
| DURATION="${DURATION_SEC}초 (약 $(( DURATION_SEC / 60 ))분)" | |
| if [ "${{ job.status }}" = "success" ]; then | |
| ICON=":white_check_mark:" | |
| STATUS="배포 성공" | |
| else | |
| ICON=":x:" | |
| STATUS="배포 실패" | |
| fi | |
| curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{ | |
| \"text\": \"${ICON} *[Develop] ${STATUS}*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• Duration: ${DURATION}\n• <${ACTIONS_URL}|Actions 보기>\" | |
| }" |