This repository was archived by the owner on Dec 16, 2025. It is now read-only.
cspo Image Cache Cleaner #19
This file contains hidden or 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: cspo Image Cache Cleaner | |
| # yamllint disable rule:line-length | |
| on: # yamllint disable-line rule:truthy | |
| workflow_dispatch: | |
| schedule: | |
| # Run the GC on the first day in the month at 6am | |
| - cron: "0 6 1 * *" | |
| permissions: read-all | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} | |
| cancel-in-progress: true | |
| jobs: | |
| cache-cleaner: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # Load Golang cache build from GitHub | |
| - name: Load cspo Golang cache build from GitHub | |
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
| id: cache | |
| with: | |
| path: /tmp/.cache/cspo | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cspo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cspo- | |
| ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}- | |
| ${{ runner.os }}-go- | |
| - name: Create cspo cache directory | |
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
| shell: bash | |
| run: | | |
| mkdir -p /tmp/.cache/cspo | |
| # Clean docker's golang's cache | |
| - name: Clean cspo Golang cache from GitHub | |
| shell: bash | |
| run: | | |
| rm -f /tmp/.cache/cspo/go-build-cache.tar.gz | |
| rm -f /tmp/.cache/cspo/go-pkg-cache.tar.gz |