Image Cleanup #556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Image Cleanup | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [Alpine Mainline, Alpine Stable, Debian Mainline, Debian Stable] | |
types: [completed] | |
jobs: | |
cleanup: | |
name: Delete untagged NGINX Unprivileged Docker images on the Amazon ECR Public Gallery and the GitHub Container Registry | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Check out the codebase | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-region: ${{ secrets.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Delete untagged NGINX Unprivileged Docker images on the Amazon ECR Public Gallery | |
run: | | |
.github/workflows/scripts/delete-untagged-amazon-public-ecr-images.sh | |
- name: Delete untagged NGINX Unprivileged Docker images on the GitHub Container Registry | |
uses: stumpylog/image-cleaner-action/untagged@0924047a3709a8f39313ec9e5f5888597e3bf81b # v0.8.0 | |
with: | |
is_org: true | |
owner: nginxinc | |
package_name: nginx-unprivileged | |
do_delete: true | |
token: ${{ secrets.GITHUB_TOKEN }} |