|
6 | 6 | - production |
7 | 7 | - develop |
8 | 8 | - 'feature/**' |
| 9 | + paths: |
| 10 | + - 'apps/web/**' |
| 11 | + - 'apps/api/**' |
| 12 | + - 'apps/api-springboot/**' |
| 13 | + - 'infra/**' |
| 14 | + - 'ansible/**' |
| 15 | + - 'terraform/**' |
| 16 | + - 'monitoring/**' |
| 17 | + - 'docker-compose.yml' |
| 18 | + - '.github/workflows/**' |
9 | 19 | pull_request: |
10 | 20 | branches: |
11 | 21 | - production |
12 | 22 | - develop |
| 23 | + paths: |
| 24 | + - 'apps/web/**' |
| 25 | + - 'apps/api/**' |
| 26 | + - 'apps/api-springboot/**' |
| 27 | + - 'infra/**' |
| 28 | + - 'ansible/**' |
| 29 | + - 'terraform/**' |
| 30 | + - 'monitoring/**' |
| 31 | + - 'docker-compose.yml' |
| 32 | + - '.github/workflows/**' |
13 | 33 |
|
14 | 34 | permissions: |
15 | 35 | contents: read |
|
21 | 41 | JAVA_VERSION: '21' |
22 | 42 |
|
23 | 43 | jobs: |
| 44 | + # ============================================ |
| 45 | + # Detect Changes |
| 46 | + # ============================================ |
| 47 | + changes: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + timeout-minutes: 10 |
| 50 | + permissions: |
| 51 | + contents: read |
| 52 | + outputs: |
| 53 | + web: ${{ steps.filter.outputs.web }} |
| 54 | + api: ${{ steps.filter.outputs.api }} |
| 55 | + springboot: ${{ steps.filter.outputs.springboot }} |
| 56 | + infra: ${{ steps.filter.outputs.infra }} |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - uses: dorny/paths-filter@v3 |
| 60 | + id: filter |
| 61 | + with: |
| 62 | + filters: | |
| 63 | + web: |
| 64 | + - 'apps/web/**' |
| 65 | + - '.github/workflows/**' |
| 66 | + api: |
| 67 | + - 'apps/api/**' |
| 68 | + - '.github/workflows/**' |
| 69 | + springboot: |
| 70 | + - 'apps/api-springboot/**' |
| 71 | + - '.github/workflows/**' |
| 72 | + infra: |
| 73 | + - 'infra/**' |
| 74 | + - 'ansible/**' |
| 75 | + - 'terraform/**' |
| 76 | + - 'monitoring/**' |
| 77 | + - 'docker-compose.yml' |
| 78 | + - '.github/workflows/**' |
| 79 | +
|
24 | 80 | # ============================================ |
25 | 81 | # Web (Next.js) CI |
26 | 82 | # ============================================ |
27 | 83 | web-ci: |
28 | 84 | name: Web - Build & Test |
29 | | - if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.event.head_commit.message, 'test')" |
| 85 | + needs: changes |
| 86 | + if: ${{ needs.changes.outputs.web == 'true' }} |
30 | 87 | runs-on: ubuntu-latest |
31 | 88 | defaults: |
32 | 89 | run: |
|
70 | 127 | # ============================================ |
71 | 128 | api-nestjs-ci: |
72 | 129 | name: API NestJS - Build & Test |
73 | | - if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.event.head_commit.message, 'test')" |
| 130 | + needs: changes |
| 131 | + if: ${{ needs.changes.outputs.api == 'true' }} |
74 | 132 | runs-on: ubuntu-latest |
75 | 133 | defaults: |
76 | 134 | run: |
@@ -159,7 +217,8 @@ jobs: |
159 | 217 | # ============================================ |
160 | 218 | api-springboot-ci: |
161 | 219 | name: API Spring Boot - Build & Test |
162 | | - if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.event.head_commit.message, 'test')" |
| 220 | + needs: changes |
| 221 | + if: ${{ needs.changes.outputs.springboot == 'true' }} |
163 | 222 | runs-on: ubuntu-latest |
164 | 223 | defaults: |
165 | 224 | run: |
@@ -229,7 +288,8 @@ jobs: |
229 | 288 | # ============================================ |
230 | 289 | infra-ci: |
231 | 290 | name: Infrastructure - Validate |
232 | | - if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.event.head_commit.message, 'test')" |
| 291 | + needs: changes |
| 292 | + if: ${{ needs.changes.outputs.infra == 'true' }} |
233 | 293 | runs-on: ubuntu-latest |
234 | 294 |
|
235 | 295 | steps: |
|
0 commit comments