@@ -3,7 +3,7 @@ name: Deploy
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - debug-smoke-test
7
7
8
8
pull_request :
9
9
branches :
31
31
CONTAINER_REGISTRY : ghcr.io
32
32
33
33
jobs :
34
- docker :
35
- name : Docker build and push
36
- if : contains(github.event.pull_request.labels.*.name, 'deploy') || github.event_name != 'pull_request'
37
- runs-on : ubuntu-latest
38
- outputs :
39
- docker_image : ${{ steps.dockerimage.outputs.docker_image_tag }}
40
- steps :
41
- - uses : actions/checkout@v4
42
- - uses : ./.github/workflows/actions/build-docker
43
- id : dockerimage
44
- with :
45
- github_username : ${{ github.actor }}
46
- github_token : ${{ secrets.GITHUB_TOKEN }}
47
-
48
- deploy_review :
49
- name : Deploy to review environment
50
- concurrency : deploy_review_${{ github.event.pull_request.number }}
51
- needs : [docker]
52
- runs-on : ubuntu-latest
53
- if : contains(github.event.pull_request.labels.*.name, 'deploy')
54
- environment :
55
- name : review
56
-
57
- steps :
58
- - uses : actions/checkout@v4
59
- - uses : ./.github/workflows/actions/deploy
60
- id : deploy
61
- with :
62
- environment : review
63
- docker_image : ${{ needs.docker.outputs.docker_image }}
64
- azure-credentials : ${{ secrets.AZURE_CREDENTIALS }}
65
- arm-access-key : ${{ secrets.ARM_ACCESS_KEY }}
66
- pr-id : ${{ github.event.pull_request.number }}
67
-
68
- - name : Post sticky pull request comment
69
- if : github.event_name == 'pull_request'
70
- uses : marocchino/sticky-pull-request-comment@v2
71
- with :
72
- message : |
73
- AKS review app deployed to https://find-a-lost-trn-review-pr-${{ github.event.pull_request.number }}.test.teacherservices.cloud
34
+ # docker:
35
+ # name: Docker build and push
36
+ # if: contains(github.event.pull_request.labels.*.name, 'deploy') || github.event_name != 'pull_request'
37
+ # runs-on: ubuntu-latest
38
+ # outputs:
39
+ # docker_image: ${{ steps.dockerimage.outputs.docker_image_tag }}
40
+ # steps:
41
+ # - uses: actions/checkout@v4
42
+ # - uses: ./.github/workflows/actions/build-docker
43
+ # id: dockerimage
44
+ # with:
45
+ # github_username: ${{ github.actor }}
46
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
47
+
48
+ # deploy_review:
49
+ # name: Deploy to review environment
50
+ # concurrency: deploy_review_${{ github.event.pull_request.number }}
51
+ # needs: [docker]
52
+ # runs-on: ubuntu-latest
53
+ # if: contains(github.event.pull_request.labels.*.name, 'deploy')
54
+ # environment:
55
+ # name: review
56
+
57
+ # steps:
58
+ # - uses: actions/checkout@v4
59
+ # - uses: ./.github/workflows/actions/deploy
60
+ # id: deploy
61
+ # with:
62
+ # environment: review
63
+ # docker_image: ${{ needs.docker.outputs.docker_image }}
64
+ # azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
65
+ # arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
66
+ # pr-id: ${{ github.event.pull_request.number }}
67
+
68
+ # - name: Post sticky pull request comment
69
+ # if: github.event_name == 'pull_request'
70
+ # uses: marocchino/sticky-pull-request-comment@v2
71
+ # with:
72
+ # message: |
73
+ # AKS review app deployed to https://find-a-lost-trn-review-pr-${{ github.event.pull_request.number }}.test.teacherservices.cloud
74
74
75
75
set_matrix :
76
76
name : Set deployment matrix
84
84
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
85
85
DEPLOYMENT_MATRIX="{ 'environment': ['${{ github.event.inputs.environment }}'] }"
86
86
else
87
- DEPLOYMENT_MATRIX="{ 'environment': ['development', 'test', 'preproduction'] }"
87
+ DEPLOYMENT_MATRIX="{ 'environment': ['preproduction'] }"
88
+ # DEPLOYMENT_MATRIX="{ 'environment': ['development', 'test', 'preproduction'] }"
88
89
fi
89
90
echo "deployment_matrix=$DEPLOYMENT_MATRIX" >> $GITHUB_OUTPUT
90
91
93
94
runs-on : ubuntu-latest
94
95
if : github.ref == 'refs/heads/main' && github.event_name == 'push'
95
96
concurrency : deploy_${{ matrix.environment }}
96
- needs : [docker, set_matrix]
97
+ needs : [set_matrix]
98
+ # needs: [docker, set_matrix]
97
99
strategy :
98
100
fail-fast : false # this is necessary to prevent early terminiation of terraform deployments that will result in tfstate locks
99
101
max-parallel : 3
@@ -120,71 +122,71 @@ jobs:
120
122
echo "::add-mask::$SLACK_WEBHOOK"
121
123
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
122
124
123
- - uses : ./.github/workflows/actions/deploy
124
- id : deploy
125
- with :
126
- environment : ${{ matrix.environment }}
127
- docker_image : ${{ needs.docker.outputs.docker_image }}
128
- azure-credentials : ${{ secrets.AZURE_CREDENTIALS }}
129
- arm-access-key : ${{ secrets.ARM_ACCESS_KEY }}
125
+ # - uses: ./.github/workflows/actions/deploy
126
+ # id: deploy
127
+ # with:
128
+ # environment: ${{ matrix.environment }}
129
+ # docker_image: ${{ needs.docker.outputs.docker_image }}
130
+ # azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
131
+ # arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
130
132
131
133
- uses : ./.github/workflows/actions/smoke-test
132
134
id : smoke-test
133
135
with :
134
136
environment : ${{ matrix.environment }}
135
137
azure_credentials : ${{ secrets.AZURE_CREDENTIALS }}
136
138
137
- - name : Slack Notification
138
- if : failure()
139
- uses : rtCamp/action-slack-notify@master
140
- env :
141
- SLACK_COLOR : failure
142
- SLACK_TITLE : Failure deploying release to ${{ matrix.environment }}
143
- SLACK_MESSAGE : Failure deploying release to ${{ matrix.environment }} - Docker tag ${{ needs.docker.outputs.docker_image }}
144
- SLACK_WEBHOOK : ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
145
-
146
- deploy_production :
147
- name : Deploy to production environment
148
- runs-on : ubuntu-latest
149
- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
150
- environment :
151
- name : production
152
- url : ${{ steps.deploy.outputs.environment_url }}
153
- concurrency : deploy_production
154
- needs : [docker, deploy_nonprod]
155
-
156
- outputs :
157
- environment_url : ${{ steps.deploy.outputs.environment_url }}
158
-
159
- steps :
160
- - uses : actions/checkout@v4
161
-
162
- - uses : azure/login@v2
163
- with :
164
- creds : ${{ secrets.AZURE_CREDENTIALS }}
165
-
166
- - name : Fetch secrets from key vault
167
- uses : azure/CLI@v2
168
- id : keyvault-yaml-secret
169
- with :
170
- inlineScript : |
171
- SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
172
- echo "::add-mask::$SLACK_WEBHOOK"
173
- echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
174
-
175
- - uses : ./.github/workflows/actions/deploy
176
- id : deploy
177
- with :
178
- environment : production
179
- docker_image : ${{ needs.docker.outputs.docker_image }}
180
- azure-credentials : ${{ secrets.AZURE_CREDENTIALS }}
181
- arm-access-key : ${{ secrets.ARM_ACCESS_KEY }}
182
-
183
- - name : Slack Notification
184
- if : failure()
185
- uses : rtCamp/action-slack-notify@master
186
- env :
187
- SLACK_COLOR : failure
188
- SLACK_TITLE : Failure deploying release to production
189
- SLACK_MESSAGE : Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
190
- SLACK_WEBHOOK : ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
139
+ # - name: Slack Notification
140
+ # if: failure()
141
+ # uses: rtCamp/action-slack-notify@master
142
+ # env:
143
+ # SLACK_COLOR: failure
144
+ # SLACK_TITLE: Failure deploying release to ${{ matrix.environment }}
145
+ # SLACK_MESSAGE: Failure deploying release to ${{ matrix.environment }} - Docker tag ${{ needs.docker.outputs.docker_image }}
146
+ # SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
147
+
148
+ # deploy_production:
149
+ # name: Deploy to production environment
150
+ # runs-on: ubuntu-latest
151
+ # if: github.ref == 'refs/heads/main' && github.event_name == 'push'
152
+ # environment:
153
+ # name: production
154
+ # url: ${{ steps.deploy.outputs.environment_url }}
155
+ # concurrency: deploy_production
156
+ # needs: [docker, deploy_nonprod]
157
+
158
+ # outputs:
159
+ # environment_url: ${{ steps.deploy.outputs.environment_url }}
160
+
161
+ # steps:
162
+ # - uses: actions/checkout@v4
163
+
164
+ # - uses: azure/login@v2
165
+ # with:
166
+ # creds: ${{ secrets.AZURE_CREDENTIALS }}
167
+
168
+ # - name: Fetch secrets from key vault
169
+ # uses: azure/CLI@v2
170
+ # id: keyvault-yaml-secret
171
+ # with:
172
+ # inlineScript: |
173
+ # SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
174
+ # echo "::add-mask::$SLACK_WEBHOOK"
175
+ # echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
176
+
177
+ # - uses: ./.github/workflows/actions/deploy
178
+ # id: deploy
179
+ # with:
180
+ # environment: production
181
+ # docker_image: ${{ needs.docker.outputs.docker_image }}
182
+ # azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
183
+ # arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
184
+
185
+ # - name: Slack Notification
186
+ # if: failure()
187
+ # uses: rtCamp/action-slack-notify@master
188
+ # env:
189
+ # SLACK_COLOR: failure
190
+ # SLACK_TITLE: Failure deploying release to production
191
+ # SLACK_MESSAGE: Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
192
+ # SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
0 commit comments