-
Notifications
You must be signed in to change notification settings - Fork 199
32 lines (27 loc) · 1.04 KB
/
cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Cleanup Old Images
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
branches: [ master, ci-build-image ]
schedule:
# Build the image regularly (each Friday) to get new security fixes, even if pushes don't occur
- cron: '13 23 * * 5'
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
#
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.IMAGE_NAME }}
package-type: 'container'
min-versions-to-keep: 2