From 08eb503d7e3ce739bed9422c1d7514d9e4344950 Mon Sep 17 00:00:00 2001 From: Glass Date: Thu, 16 Nov 2023 14:25:17 -0700 Subject: [PATCH] docker prune before updating services (#480) ### Related issues - Closes #479 --- .github/workflows/build-and-deploy-images.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy-images.yaml b/.github/workflows/build-and-deploy-images.yaml index df784f659..7551328e8 100644 --- a/.github/workflows/build-and-deploy-images.yaml +++ b/.github/workflows/build-and-deploy-images.yaml @@ -105,7 +105,11 @@ jobs: version: ">= 447.0.0" - name: "Update API Service" - run: gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_api --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-api:${{ github.sha }} + run: | + gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker system prune -f + gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_api --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-api:${{ github.sha }} - name: "Update UI Service" - run: gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_nginx --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-ui:${{ github.sha }} + run: | + gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker system prune -f + gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_nginx --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-ui:${{ github.sha }}