Skip to content

Commit

Permalink
update workflow to save only last 3 images
Browse files Browse the repository at this point in the history
  • Loading branch information
bigsk1 committed Jul 4, 2024
1 parent 6eb5975 commit d97c764
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,24 @@ jobs:
file: ./docker/backend/Dockerfile.backend
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}
labels: ${{ steps.meta-backend.outputs.labels }}

cleanup-packages:
runs-on: ubuntu-latest
needs: build-and-push-image # This ensures cleanup runs after successful build and push
steps:
- name: Delete old frontend packages
uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.FRONTEND_IMAGE_NAME }}
package-type: 'container'
min-versions-to-keep: 3
delete-only-untagged-versions: false

- name: Delete old backend packages
uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.BACKEND_IMAGE_NAME }}
package-type: 'container'
min-versions-to-keep: 3
delete-only-untagged-versions: false

0 comments on commit d97c764

Please sign in to comment.