Skip to content

Commit

Permalink
new workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
bigsk1 committed Jul 4, 2024
1 parent b4d4606 commit 552e647
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,21 @@ jobs:
permissions:
packages: write
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
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitHub CLI
run: sudo apt-get install -y gh

- 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
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup old frontend packages
env:
PACKAGE_NAME: ${{ env.FRONTEND_IMAGE_NAME }}
PACKAGE_OWNER: ${{ github.repository_owner }}
run: |
gh api --paginate -H "Accept: application/vnd.github+json" /orgs/${PACKAGE_OWNER}/packages/container/${PACKAGE_NAME}/versions > versions.json
jq -r '.[].id' versions.json | tail -n +4 | xargs -I {} gh api --method DELETE /orgs/${PACKAGE_OWNER}/packages/container/${PACKAGE_NAME}/versions/{} --silent
- name: Cleanup old backend packages
env:
PACKAGE_NAME: ${{ env.BACKEND_IMAGE_NAME }}
PACKAGE_OWNER: ${{ github.repository_owner }}
run: |
gh api --paginate -H "Accept: application/vnd.github+json" /orgs/${PACKAGE_OWNER}/packages/container/${PACKAGE_NAME}/versions > versions.json
jq -r '.[].id' versions.json | tail -n +4 | xargs -I {} gh api --method DELETE /orgs/${PACKAGE_OWNER}/packages/container/${PACKAGE_NAME}/versions/{} --silent

0 comments on commit 552e647

Please sign in to comment.