|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - main |
8 | | - - qa |
9 | | - - test |
10 | | - - dev |
11 | 8 | paths: |
12 | 9 | - "src/**" |
13 | 10 | - "templates/terraform/**" |
@@ -54,42 +51,42 @@ jobs: |
54 | 51 | echo "labels=$labels" >> $GITHUB_OUTPUT |
55 | 52 | echo "labels=$labels" |
56 | 53 |
|
57 | | - call-deploy-workflow-main: |
58 | | - if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main' && github.event.pull_request.draft == false) }} |
| 54 | + deploy-dev: |
| 55 | + if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && contains(needs.conditions.outputs.labels, 'deploy-azure')) }} |
59 | 56 | needs: [conditions] |
60 | 57 | uses: hwinther/test/.github/workflows/deploy-cd.yml@main |
61 | 58 | with: |
62 | | - deploy_target: prod |
63 | | - repo_name: main |
| 59 | + deploy_target: dev |
| 60 | + repo_name: dev |
64 | 61 | labels: ${{ needs.conditions.outputs.labels }} |
65 | 62 | secrets: inherit |
66 | 63 |
|
67 | | - call-deploy-workflow-qa: |
68 | | - if: ${{ github.ref == 'refs/heads/qa' || (github.event_name == 'pull_request' && github.base_ref == 'qa' && github.event.pull_request.draft == false) }} |
69 | | - needs: [conditions] |
70 | | - uses: hwinther/test/.github/workflows/deploy-cd.yml@qa |
| 64 | + deploy-test: |
| 65 | + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} |
| 66 | + needs: [conditions, deploy-dev] |
| 67 | + uses: hwinther/test/.github/workflows/deploy-cd.yml@main |
71 | 68 | with: |
72 | | - deploy_target: qa |
73 | | - repo_name: qa |
| 69 | + deploy_target: test |
| 70 | + repo_name: test |
74 | 71 | labels: ${{ needs.conditions.outputs.labels }} |
75 | 72 | secrets: inherit |
76 | 73 |
|
77 | | - call-deploy-workflow-test: |
78 | | - if: ${{ github.ref == 'refs/heads/test' || (github.event_name == 'pull_request' && github.base_ref == 'test' && github.event.pull_request.draft == false) }} |
79 | | - needs: [conditions] |
80 | | - uses: hwinther/test/.github/workflows/deploy-cd.yml@test |
| 74 | + deploy-qa: |
| 75 | + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} |
| 76 | + needs: [conditions, deploy-test] |
| 77 | + uses: hwinther/test/.github/workflows/deploy-cd.yml@main |
81 | 78 | with: |
82 | | - deploy_target: test |
83 | | - repo_name: test |
| 79 | + deploy_target: qa |
| 80 | + repo_name: qa |
84 | 81 | labels: ${{ needs.conditions.outputs.labels }} |
85 | 82 | secrets: inherit |
86 | 83 |
|
87 | | - call-deploy-workflow-dev: |
88 | | - if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && contains(needs.conditions.outputs.labels, 'deploy-azure')) }} |
89 | | - needs: [conditions] |
90 | | - uses: hwinther/test/.github/workflows/deploy-cd.yml@dev |
| 84 | + deploy-prod: |
| 85 | + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} |
| 86 | + needs: [conditions, deploy-qa] |
| 87 | + uses: hwinther/test/.github/workflows/deploy-cd.yml@main |
91 | 88 | with: |
92 | | - deploy_target: dev |
93 | | - repo_name: dev |
| 89 | + deploy_target: prod |
| 90 | + repo_name: main |
94 | 91 | labels: ${{ needs.conditions.outputs.labels }} |
95 | 92 | secrets: inherit |
0 commit comments