-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (37 loc) · 1.32 KB
/
schedule-cache-cleaner-cso-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: CSO 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-20.04
steps:
# Load Golang cache build from GitHub
- name: Load cso Golang cache build from GitHub
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: cache
with:
path: /tmp/.cache/cso
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cso-${{ github.sha }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cso-
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-
${{ runner.os }}-go-
- name: Create cso cache directory
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
mkdir -p /tmp/.cache/cso
# Clean docker's golang's cache
- name: Clean cso Golang cache from GitHub
shell: bash
run: |
rm -f /tmp/.cache/cso/go-build-cache.tar.gz
rm -f /tmp/.cache/cso/go-pkg-cache.tar.gz