Skip to content

Commit

Permalink
remove old images cleanup from workflow for now
Browse files Browse the repository at this point in the history
  • Loading branch information
bigsk1 committed Jul 4, 2024
1 parent b3ed198 commit c25d10c
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,3 @@ jobs:
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}

cleanup-packages:
runs-on: ubuntu-latest
needs: build-and-push-image
permissions:
contents: read
packages: write
steps:
- name: Install GitHub CLI
run: sudo apt-get install -y gh

- name: Cleanup old frontend packages
env:
PACKAGE_NAME: ${{ env.FRONTEND_IMAGE_NAME }}
PACKAGE_OWNER: ${{ github.repository_owner }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 c25d10c

Please sign in to comment.