Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CON-2486-add-sanitize-action #11

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/ga-image-sanitize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: 🧼 Sanitize – Generated Docker Images

on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
keep-last:
description: >
Delete all untagged images except the last N
required: false
default: "1"

jobs:
delete-pr-tagged-image:
name: 🗑️ Delete PR${{github.event.pull_request.number}} Image
runs-on: ubuntu-latest
steps:
- name: 🗑️ Delete 🚀 API Gateway image PR${{github.event.pull_request.number}}
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-api-gateway-app
token: ${{ secrets.GITHUB_TOKEN }}
tag: PR${{github.event.pull_request.number}}
continue-on-error: true

- name: 🗑️ Delete 🧩 Inventory App image PR${{github.event.pull_request.number}}
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-inventory-app
token: ${{ secrets.GITHUB_TOKEN }}
tag: PR${{github.event.pull_request.number}}
continue-on-error: true

- name: 🗑️ Delete 💻 Postgres DB image PR${{github.event.pull_request.number}}
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-postgres-db
token: ${{ secrets.GITHUB_TOKEN }}
tag: PR${{github.event.pull_request.number}}
continue-on-error: true

- name: 🗑️ Delete 🐰 Rabbitmq image PR${{github.event.pull_request.number}}
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-rabbitmq
token: ${{ secrets.GITHUB_TOKEN }}
tag: PR${{github.event.pull_request.number}}
continue-on-error: true

- name: 🗑️ Delete 💰 Billing App image PR${{github.event.pull_request.number}}
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-billing-app
token: ${{ secrets.GITHUB_TOKEN }}
tag: PR${{github.event.pull_request.number}}
continue-on-error: true

delete-untagged-images:
name: 🔥 Clear Untagged Images
needs: delete-pr-tagged-image
runs-on: ubuntu-latest
steps:
- name: 🔥 Clear all untagged 🚀 API Gateway image
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-api-gateway-app
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: ${{ github.event.inputs.keep-last }}
continue-on-error: true

- name: 🗑️ Delete 🧩 Inventory App image
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-inventory-app
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: ${{ github.event.inputs.keep-last }}
continue-on-error: true

- name: 🗑️ Delete 💻 Postgres DB image
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-postgres-db
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: ${{ github.event.inputs.keep-last }}
continue-on-error: true

- name: 🗑️ Delete 🐰 Rabbitmq image
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-rabbitmq
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: ${{ github.event.inputs.keep-last }}
continue-on-error: true

- name: 🗑️ Delete 💰 Billing App image
uses: bots-house/[email protected]
with:
owner: 01-edu
name: content-billing-app
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: ${{ github.event.inputs.keep-last }}
continue-on-error: true
Loading