Skip to content

Cleanup and Maintainance #136

Cleanup and Maintainance

Cleanup and Maintainance #136

name: 'Cleanup and Maintainance'
on:
workflow_dispatch:
schedule:
- cron: '19 17 * * MON'
jobs:
# dockercleanup:
# runs-on: ubuntu-latest
# name: "Pruning Untagged Images of ${{ matrix.containers }}"
# strategy:
# matrix:
# containers: [ 'tailormap-viewer', 'tailormap-config-db', 'tailormap']
# steps:
# - name: 'Untagged older than 1 week, keeping last 2'
# # https://github.com/marketplace/actions/ghcr-pruning
# uses: 'vlaurin/action-ghcr-prune@v0.5.0'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 7
# keep-last: 2
# prune-untagged: true
#
# - name: 'All untagged older than 4 weeks'
# uses: 'vlaurin/action-ghcr-prune@v0.5.0'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 28
# keep-last: 0
# prune-untagged: true
#
# - name: 'Tagged PRs older than 4 weeks'
# uses: 'vlaurin/action-ghcr-prune@v0.5.0'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 28
# keep-last: 0
# prune-tags-regexes: ^pr-
stale:
runs-on: ubuntu-latest
name: 'Close Stale PRs'
permissions:
pull-requests: write
steps:
- uses: 'actions/stale@v9'
with:
days-before-stale: 60
days-before-close: 10
workflows:
runs-on: ubuntu-latest
name: 'Cleanup old workflow runs'
steps:
- uses: 'Mattraks/delete-workflow-runs@v2'
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
# same as "Artifact and log retention" in https://github.com/B3Partners/tailormap-viewer/settings/actions
retain_days: 90
keep_minimum_runs: 2