Skip to content

Commit 27b9c1a

Browse files
authored
Completed updating release workflows (#1284)
1 parent fa7c669 commit 27b9c1a

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/deploy.test.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# - Then deploys to test environment (if dev succeeds)
1313
# - Validates image existence before deployment
1414
# - Uses edge tag by default, or custom tag if specified
15+
# - When triggered by build-edge, uses commit SHA so Azure actually pulls a new image
16+
# - When manually triggered, uses provided tag or edge
1517

1618
name: Deploy to Dev and Test
1719

@@ -39,6 +41,8 @@ jobs:
3941
deploy-to-dev:
4042
runs-on: ubuntu-latest
4143
environment: dev
44+
env:
45+
IMAGE_TAG: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.event.inputs.image_tag || 'edge' }}
4246
steps:
4347
# Check that images exist before deploying (only for manual dispatch with custom tags)
4448
- uses: tyriis/docker-image-tag-exists@71a750a41aa78e4efb0842f538140c5df5b8166f # v2.1.0
@@ -74,58 +78,60 @@ jobs:
7478
with:
7579
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
7680
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
77-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/backend:${{ github.event.inputs.image_tag || 'edge' }}
81+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/backend:${{ env.IMAGE_TAG }}
7882

7983
- name: Deploy Frontend to Dev
8084
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
8185
with:
8286
app-name: ${{ vars.AZURE_WEBAPP_NEXT_NAME }}
8387
publish-profile: ${{ secrets.AZURE_WEBAPP_NEXT_PUBLISH_PROFILE }}
84-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/frontend:${{ github.event.inputs.image_tag || 'edge' }}
88+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/frontend:${{ env.IMAGE_TAG }}
8589

8690
- name: Deploy Airflow Webserver to Dev
8791
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
8892
with:
8993
app-name: ${{ vars.AIRFLOW_WEBSERVER_NAME }}
9094
publish-profile: ${{ secrets.AIRFLOW_WEBSERVER_PUBLISH_PROFILE }}
91-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-webserver:${{ github.event.inputs.image_tag || 'edge' }}
95+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-webserver:${{ env.IMAGE_TAG }}
9296

9397
- name: Deploy Airflow Scheduler to Dev
9498
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
9599
with:
96100
app-name: ${{ vars.AIRFLOW_SCHEDULER_NAME }}
97101
publish-profile: ${{ secrets.AIRFLOW_SCHEDULER_PUBLISH_PROFILE }}
98-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-scheduler:${{ github.event.inputs.image_tag || 'edge' }}
102+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-scheduler:${{ env.IMAGE_TAG }}
99103

100104
deploy-to-test:
101105
runs-on: ubuntu-latest
102106
environment: test
103107
needs: [deploy-to-dev]
108+
env:
109+
IMAGE_TAG: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.event.inputs.image_tag || 'edge' }}
104110
steps:
105111
- name: Deploy Backend to Test
106112
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
107113
with:
108114
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
109115
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
110-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/backend:${{ github.event.inputs.image_tag || 'edge' }}
116+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/backend:${{ env.IMAGE_TAG }}
111117

112118
- name: Deploy Frontend to Test
113119
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
114120
with:
115121
app-name: ${{ vars.AZURE_WEBAPP_NEXT_NAME }}
116122
publish-profile: ${{ secrets.AZURE_WEBAPP_NEXT_PUBLISH_PROFILE }}
117-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/frontend:${{ github.event.inputs.image_tag || 'edge' }}
123+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/frontend:${{ env.IMAGE_TAG }}
118124

119125
- name: Deploy Airflow Webserver to Test
120126
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
121127
with:
122128
app-name: ${{ vars.AIRFLOW_WEBSERVER_NAME }}
123129
publish-profile: ${{ secrets.AIRFLOW_WEBSERVER_PUBLISH_PROFILE }}
124-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-webserver:${{ github.event.inputs.image_tag || 'edge' }}
130+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-webserver:${{ env.IMAGE_TAG }}
125131

126132
- name: Deploy Airflow Scheduler to Test
127133
uses: azure/webapps-deploy@2fdd5c3ebb4e540834e86ecc1f6fdcd5539023ee # v3.0.2
128134
with:
129135
app-name: ${{ vars.AIRFLOW_SCHEDULER_NAME }}
130136
publish-profile: ${{ secrets.AIRFLOW_SCHEDULER_PUBLISH_PROFILE }}
131-
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-scheduler:${{ github.event.inputs.image_tag || 'edge' }}
137+
images: ${{ env.registry }}/${{ env.repo-owner }}/${{ env.app-name }}/airflow-scheduler:${{ env.IMAGE_TAG }}

0 commit comments

Comments
 (0)