diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d2ee5d1..e3b97be 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -90,3 +90,7 @@ jobs: --container-image us-east1-docker.pkg.dev/rmfp-bot/rmfp-repo/rmfp-bot:${{ inputs.image_tag }} \ --container-mount-disk mount-path="/usr/src/app/db",name=${{ env.DB_NAME }} \ --container-env-file ./.env + - name: '✂️ Run `docker system prune`' + run: | + sleep 5 + gcloud compute ssh --zone "us-east1-b" "${{ env.APP_NAME }}" --project "rmfp-bot" --command "docker system prune -af" diff --git a/.github/workflows/main_build_deploy.yml b/.github/workflows/main_build_deploy.yml index 88edece..2bb5916 100644 --- a/.github/workflows/main_build_deploy.yml +++ b/.github/workflows/main_build_deploy.yml @@ -31,7 +31,7 @@ jobs: echo "PUSH_DB=false" >> "$GITHUB_OUTPUT" fi fi - - name: Set docker tag + - name: '🏷️Set docker tag' id: tag run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: '🔑 Authenticate With GCP' @@ -49,6 +49,9 @@ jobs: docker tag rmfp-bot us-east1-docker.pkg.dev/rmfp-bot/rmfp-repo/rmfp-bot:latest docker tag rmfp-bot us-east1-docker.pkg.dev/rmfp-bot/rmfp-repo/rmfp-bot:${{ steps.tag.outputs.sha }} docker push --all-tags us-east1-docker.pkg.dev/rmfp-bot/rmfp-repo/rmfp-bot + - name: '😴 Sleep to allow GCP to catch up' + run: | + sleep 10 deploy: needs: build_upload uses: ./.github/workflows/deploy.yml