Skip to content

Commit 5964206

Browse files
committed
New workflows
1 parent 7452b15 commit 5964206

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Delete old container images
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # every day at midnight
6+
workflow_dispatch:
7+
inputs:
8+
logLevel:
9+
description: 'Log level'
10+
required: true
11+
default: 'warning'
12+
tags:
13+
description: 'Testing the container deletion mechanism'
14+
15+
jobs:
16+
purge-image:
17+
name: Delete image from ghcr.io
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
steps:
23+
- name: Get repository name
24+
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
25+
shell: bash
26+
- name: Delete image release candiate
27+
uses: r26d/[email protected]
28+
with:
29+
owner: ${{ github.repository_owner }}
30+
name: ${{ env.REPOSITORY_NAME }}
31+
token: ${{ secrets.GH_DELETE_PACKAGE }}
32+
tagged-keep-latest: 5
33+
untagged-keep-latest: 5
34+
tag-regex: \d\.\d.\d-rc\d
35+
36+
37+

.github/workflows/docker-publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
schedule:
1010
- cron: '30 3,12 * * *'
1111
push:
12-
branches: [ $default-branch ]
12+
branches: [ master, next ]
1313
# Publish semver tags as releases.
1414
tags: [ 'v*.*.*' ]
1515
pull_request:
16-
branches: [ $default-branch ]
16+
branches: [ master, next ]
1717
workflow_dispatch:
1818
inputs:
1919
logLevel:
@@ -59,6 +59,13 @@ jobs:
5959
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
6060
with:
6161
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
62+
tags: |
63+
type=schedule
64+
type=ref,event=branch
65+
type=ref,event=pr
66+
type=semver,pattern=v{{version}}
67+
type=semver,pattern=v{{major}}.{{minor}}
68+
type=semver,pattern=v{{major}}
6269
6370
# Build and push Docker image with Buildx (don't push on PR)
6471
# https://github.com/docker/build-push-action

0 commit comments

Comments
 (0)