Skip to content

Commit 706b1a4

Browse files
committed
Update build.yaml
1 parent b00c81c commit 706b1a4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ jobs:
3232
# ./gen-rel-notes.sh > CHANGELOG
3333

3434
- name: Build and push
35-
run: |
36-
cp tdei_uw.env .env
37-
echo "CODE_VERSION=${CODE_VERSION}" >> .env
38-
docker buildx bake --file docker-compose.build.yml --push
35+
run: docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION}
3936
env:
4037
ENV: ${{ vars.ENV }}
4138
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
@@ -81,8 +78,15 @@ jobs:
8178
docker context create dev --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
8279
docker context use dev
8380
81+
# stop all running images, remove the containers, remove the images
82+
# why? in case we're rebuilding the image of the same commit, we want to ensure the newer image is deployed
83+
# in case the last one was corrupted for some reason--just to avoid any questions about deployment reliability
84+
docker stop $(docker ps -q)
85+
docker rm -v $(docker ps --filter status=exited -q)
86+
docker rmi $(docker images -q)
87+
8488
# remove images no longer in use--may need disk space to pull
85-
docker image prune -a -f
89+
# docker image prune -a -f
8690
8791
# pull new images, recreate containers
8892
docker compose -f docker-compose.deploy.yml --env-file tdei_uw.env up -d --force-recreate --remove-orphans

0 commit comments

Comments
 (0)