@@ -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'
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