Skip to content

Commit

Permalink
prune after deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
eashwar committed May 20, 2024
1 parent 587c465 commit 05d6e33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 4 additions & 1 deletion .github/workflows/main_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit 05d6e33

Please sign in to comment.