clean-testing-package #796
Workflow file for this run
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
# This workflow runs daily to clean up the `*-testing` images older than the | |
# cut-off period specified in `snok/container-retention-policy` | |
name: clean-testing-package | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
IMAGE_NAME: "cloudnative-pg-testing" | |
ORG_NAME: "enterprisedb" | |
SNOK_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CONTAINER_IMAGE_NAMES: "pgbouncer-testing, postgresql-testing, postgis-testing" | |
jobs: | |
clean-ghcr: | |
name: delete old testing container images | |
runs-on: ubuntu-latest | |
steps: | |
# once issue https://github.com/snok/container-retention-policy/issues/33 is fixed | |
# we can merge the two steps into one | |
- name: Delete '-testing' images for ${{ env.IMAGE_NAME }} | |
uses: snok/[email protected] | |
with: | |
image-names: ${{ env.IMAGE_NAME }} | |
cut-off: 5 days ago UTC | |
keep-n-most-recent: 1 | |
account: ${{ env.ORG_NAME }} | |
# use the GITHUB_TOKEN when issue https://github.com/snok/container-retention-policy/issues/27 is fixed | |
token: ${{ env.SNOK_TOKEN }} | |
- name: Delete '-testing' images for containers | |
uses: snok/[email protected] | |
with: | |
image-names: ${{ env.CONTAINER_IMAGE_NAMES }} | |
cut-off: A week ago UTC | |
keep-n-most-recent: 1 | |
account: ${{ env.ORG_NAME }} | |
# use the GITHUB_TOKEN when issue https://github.com/snok/container-retention-policy/issues/27 is fixed | |
token: ${{ env.SNOK_TOKEN }} |