|
1 | | -name: Prod CI/CD - Build, Push and Deploy |
| 1 | +name: Prod CI/CD - Build, Push and Deploy (Sequential with Matrix) |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
|
14 | 14 | IMAGE_PREFIX: ninecraft0523/ninecraft |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - build-push-and-deploy: |
| 17 | + deploy-modules: |
18 | 18 | runs-on: ubuntu-24.04 |
19 | 19 | timeout-minutes: 25 |
20 | 20 | environment: production |
21 | 21 | strategy: |
22 | | - fail-fast: false |
| 22 | + max-parallel: 1 |
| 23 | + fail-fast: true |
23 | 24 | matrix: |
24 | | - include: |
25 | | - - module: apis |
26 | | - # - module: admin # TODO: Uncomment when admin module is ready |
27 | | - - module: batch |
| 25 | + module: [apis, batch] # 배포 순서: apis → batch (배열 순서대로 실행) |
28 | 26 |
|
29 | 27 | steps: |
30 | 28 | - name: Checkout code |
31 | 29 | uses: actions/checkout@v4 |
32 | 30 |
|
33 | | - - name: Deploy module |
| 31 | + - name: Deploy ${{ matrix.module }} module |
34 | 32 | uses: ./.github/actions/deploy-module |
35 | 33 | with: |
36 | 34 | environment: prod |
|
49 | 47 | type=semver,pattern={{version}} |
50 | 48 | type=raw,value=production-latest |
51 | 49 | deploy-script: deploy-prod.sh |
| 50 | + release-version: ${{ github.event.release.tag_name }} |
| 51 | + |
| 52 | + deployment-summary: |
| 53 | + runs-on: ubuntu-24.04 |
| 54 | + needs: deploy-modules |
| 55 | + if: always() |
| 56 | + |
| 57 | + steps: |
| 58 | + - name: Send deployment summary to Discord |
| 59 | + uses: tsickert/discord-webhook@b217a69502f52803de774ded2b1ab7c282e99645 |
| 60 | + continue-on-error: true |
| 61 | + with: |
| 62 | + webhook-url: ${{ secrets.PROD_DEPLOY_DISCORD_WEBHOOK_URL }} |
| 63 | + content: "📊 **Production Deployment Summary**" |
| 64 | + embed-title: "[${{ github.repository }}] Production Deployment Completed" |
| 65 | + embed-description: | |
| 66 | + **Release**: `${{ github.event.release.tag_name }}` |
| 67 | + **Status**: ${{ needs.deploy-modules.result == 'success' && '✅ All modules deployed successfully' || '❌ Deployment failed' }} |
| 68 | + **Deployed by**: `${{ github.actor }}` |
| 69 | +
|
| 70 | + [View Release](${{ github.event.release.html_url }}) |
| 71 | + [View Workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) |
| 72 | + embed-color: ${{ needs.deploy-modules.result == 'success' && '65280' || '16711680' }} |
0 commit comments