Skip to content

Commit c654c9b

Browse files
added cleanup
Signed-off-by: Denis Romanenko <[email protected]>
1 parent 0f83d74 commit c654c9b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/cleanup.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Cleanup
2+
3+
on: [push]
4+
5+
env:
6+
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
name: Cleanup images
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: deckhouse/modules-actions/setup@main
16+
with:
17+
registry: ghcr.io
18+
registry_login: ${{ github.actor }}
19+
registry_password: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Get the repository name
22+
id: repo_name
23+
run: echo "REPO_NAME=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_OUTPUT
24+
25+
- uses: deckhouse/modules-actions/cleanup@main
26+
with:
27+
module_source: ghcr.io/${{ github.repository_owner }}/modules
28+
module_name: ${{ steps.repo_name.outputs.REPO_NAME }}
29+
module_tag: ${{ github.ref_name }}

werf_cleanup.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project: echoserver
2+
configVersion: 1
3+
cleanup:
4+
keepPolicies:
5+
- references:
6+
branch: /.*/
7+
limit:
8+
in: 168h # keep dev images build during last week which not main
9+
- references:
10+
branch: /main/
11+
imagesPerReference:
12+
last: 5 # keep 5 images for branches main

0 commit comments

Comments
 (0)