GCR Cleanup #422
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GCR Cleanup | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Every day at midnight | |
workflow_dispatch: | |
jobs: | |
cleanup: | |
name: GCR Cleanup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- id: auth | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCR_SERVICE_ACCOUNT }} | |
- name: Setup Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Run Cleanup Script | |
# Keep at least 16 images, delete images older than 720 hours (30 days) | |
run: | | |
python containers/cleangcr.py -y -k 16 -g 720 |