Registry Retention Policy #303
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: Registry Retention Policy | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: registry-retention-policy | |
jobs: | |
remove-outdated-images: | |
runs-on: [ self-hosted, small ] | |
timeout-minutes: 120 | |
steps: | |
- uses: hyperskill/[email protected] | |
with: | |
client_id: ${{ secrets.CLIENT_ID }} | |
client_secret: ${{ secrets.CLIENT_SECRET }} | |
subscription_id: ${{ secrets.SUBSCRIPTION_ID }} | |
tenant_id: ${{ secrets.TENANT_ID }} | |
- run: | | |
PURGE_CMD="acr purge \ | |
--filter 'hyperskill/dataslackbot:.*' \ | |
--ago 1d \ | |
--keep 2 \ | |
--untagged" | |
az acr run \ | |
--cmd "$PURGE_CMD" \ | |
--registry hyperskill \ | |
/dev/null |