Skip to content

Commit

Permalink
feat: removed retention file, moved to build stage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson2427 committed Aug 29, 2024
1 parent 60fa9ab commit 4fa076c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,24 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SLIM_IMAGE=${{ steps.meta.outputs.tags }}-slim
- name: Retain last two minor versions
run: |
latest_two_minors=$(git tag -l | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | awk -F. '{print $1"."$2}' | uniq | tail -n 2)
keep_tags=""
for minor in $latest_two_minors; do
latest_patch=$(git tag -l "${minor}.*" | sort -V | tail -n 1)
keep_tags="$keep_tags $latest_patch"
done
echo "keep_tags=$(echo $keep_tags)"
- name: Run container retention policy
if: github.ref == 'refs/heads/main'
uses: snok/container-retention-policy@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
keep-tag-names: |
stable
latest
${{ env.keep_tags }}
26 changes: 0 additions & 26 deletions .github/workflows/retention.yaml

This file was deleted.

0 comments on commit 4fa076c

Please sign in to comment.