6464 with :
6565 repository : NHSDigital/dtos-devops-templates
6666 path : templates
67- ref : feat/dtoss-9326-trigger-cd-pipeline-with-commit
67+ ref : main
6868
6969 - name : Determine which Docker container(s) to build
7070 id : get-function-names
@@ -126,7 +126,7 @@ jobs:
126126 with :
127127 repository : NHSDigital/dtos-devops-templates
128128 path : templates
129- ref : feat/dtoss-9326-trigger-cd-pipeline-with-commit
129+ ref : main
130130
131131 - name : Build Docker image
132132 id : docker_image
@@ -151,8 +151,7 @@ jobs:
151151 [[ -n "${ENVIRONMENT_TAG}" ]] && docker tag "${image_lc}:latest" "${reg_image}:${ENVIRONMENT_TAG}"
152152
153153 - name : AzureCLI login
154- if : always()
155- # if: (github.ref == 'refs/heads/main' && env.USE_AZURECR == 'true')
154+ if : (github.ref == 'refs/heads/main' && env.USE_AZURECR == 'true')
156155 uses : azure/login@v2
157156 with :
158157 client-id : ${{ secrets.AZURE_CLIENT_ID }}
@@ -168,8 +167,7 @@ jobs:
168167 password : ${{ github.token }}
169168
170169 - name : Push Docker image
171- # if: github.ref == 'refs/heads/main'
172- if : always()
170+ if : github.ref == 'refs/heads/main'
173171 working-directory : ${{ needs.containers-to-build.outputs.docker_compose_dir }}
174172 env :
175173 pr_num_tag : ${{ needs.containers-to-build.outputs.pr_num_tag }}
@@ -193,8 +191,7 @@ jobs:
193191
194192 tag-all-repositories :
195193 name : Merge commit tag all images
196- # if: github.ref == 'refs/heads/main'
197- if : always()
194+ if : github.ref == 'refs/heads/main'
198195 runs-on : ubuntu-latest
199196 needs : [build-and-push, containers-to-build]
200197 env :
@@ -216,20 +213,18 @@ jobs:
216213 with :
217214 repository : NHSDigital/dtos-devops-templates
218215 path : templates
219- ref : feat/dtoss-9326-trigger-cd-pipeline-with-commit
216+ ref : main
220217
221218 - name : AzureCLI login
222- # if: env.USE_AZURECR == 'true'
223- if : always()
219+ if : env.USE_AZURECR == 'true'
224220 uses : azure/login@v2
225221 with :
226222 client-id : ${{ secrets.AZURE_CLIENT_ID }}
227223 tenant-id : ${{ secrets.AZURE_TENANT_ID }}
228224 subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
229225
230226 - name : ghcr.io login
231- # if: env.USE_AZURECR == 'false'
232- if : always()
227+ if : env.USE_AZURECR == 'false'
233228 uses : docker/login-action@v3
234229 with :
235230 registry : ghcr.io
@@ -265,8 +260,7 @@ jobs:
265260 subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
266261
267262 - name : Call deployment pipeline
268- # if: success()
269- if : always()
263+ if : success()
270264 run : |
271265 az pipelines run \
272266 --branch "feat/dtoss-9326-trigger-cd-pipeline-with-commit" \
0 commit comments