Skip to content

Commit 111fa56

Browse files
committed
update deploy containers
* pull the latest version of the container down, will slightly improve performance * ensure the storage account env var is only set on what we push to azure cr
1 parent 79201e4 commit 111fa56

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/build_container.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@ jobs:
5858
5959
- name: 'Build and push image'
6060
run: |
61+
# pull latest container, if some steps haven't changed this will speed things up
62+
docker pull ghcr.io/the-strategy-unit/nhp_model:latest
6163
# build and push to GitHub Container Registry
6264
docker build . -t ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }} \
65+
--build-arg app_version=${{ inputs.app-version }} \
66+
--build-arg data_version=${{ inputs.data-version }}
67+
docker push ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }}
68+
# build and dpush to Azure Container Registry (where the app currently run from)
69+
# (include the storage account env var for the data)
70+
docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:${{ env.VERSION }} \
6371
--build-arg app_version=${{ inputs.app-version }} \
6472
--build-arg data_version=${{ inputs.data-version }} \
6573
--build-arg storage_account=${{ secrets.NHP_STORAGE_ACCOUNT }}
66-
docker push ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }}
67-
# push to Azure Container Registry (where the app currently run from)
68-
docker tag ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:${{ env.VERSION }}
6974
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:${{ env.VERSION }}
7075
7176
- name: 'Push latest'
@@ -74,5 +79,5 @@ jobs:
7479
docker tag ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }} ghcr.io/the-strategy-unit/nhp_model:latest
7580
docker push ghcr.io/the-strategy-unit/nhp_model:latest
7681
77-
docker tag ghcr.io/the-strategy-unit/nhp_model:${{ env.VERSION }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:latest
82+
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}:${{ env.VERSION }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:latest
7883
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/nhp_model:latest

0 commit comments

Comments
 (0)