mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
chore: remove GAR actions from CI
This commit is contained in:
parent
9f6eeae5c6
commit
46bf61e08f
1 changed files with 0 additions and 45 deletions
45
.github/workflows/gar-cleanup.yml
vendored
45
.github/workflows/gar-cleanup.yml
vendored
|
@ -1,45 +0,0 @@
|
||||||
name: GAR Cleanup
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '30 6 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
workflow_run:
|
|
||||||
workflows: ['Deploy']
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker_cleanup:
|
|
||||||
name: Cleanup Deployed Images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
region: [us, europe, asia]
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- name: Set up Cloud SDK
|
|
||||||
uses: google-github-actions/setup-gcloud@master
|
|
||||||
with:
|
|
||||||
project_id: ${{ secrets.GCS_PROJECT_ID }}
|
|
||||||
service_account_key: ${{ secrets.GCS_TF_KEY }}
|
|
||||||
export_default_credentials: true
|
|
||||||
|
|
||||||
- name: Delete stale artifacts
|
|
||||||
run: |
|
|
||||||
flags="--format=json --location=${{matrix.region}} --repository=roleypoly"
|
|
||||||
|
|
||||||
packagesToPrune=$(gcloud artifacts packages list $flags | jq -r '.[].name')
|
|
||||||
|
|
||||||
for package in $packagesToPrune; do
|
|
||||||
tagsToKeep=$(gcloud artifacts tags list --package=$package $flags | jq -r '.[].version')
|
|
||||||
versionsToCheck=$(gcloud artifacts versions list --package=$package $flags | jq -r '.[].name')
|
|
||||||
|
|
||||||
for version in $versionsToCheck; do
|
|
||||||
if [[ "$tagsToKeep" =~ .*"$version".* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
gcloud artifacts versions delete $version --package=$package $flags --quiet
|
|
||||||
done
|
|
||||||
done
|
|
Loading…
Add table
Reference in a new issue