-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (47 loc) · 1.61 KB
/
image-retention.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Delete old container images
on:
schedule:
- cron: "15 * * * *" # run hourly
push:
branches:
- "*"
- "!main" # excludes main
jobs:
cleanup-packages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.0
- name: Verify dependencies
run: go mod verify
working-directory: ./github-actions/cleanup-packages/
- name: Build
run: go build -v ./...
working-directory: ./github-actions/cleanup-packages/
- name: Run go vet
run: go vet ./...
working-directory: ./github-actions/cleanup-packages/
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
working-directory: ./github-actions/cleanup-packages/
- name: Run staticcheck
run: staticcheck ./...
working-directory: ./github-actions/cleanup-packages/
- name: Install golint
run: go install golang.org/x/lint/golint@latest
working-directory: ./github-actions/cleanup-packages/
- name: Run golint
run: golint ./...
working-directory: ./github-actions/cleanup-packages/
- name: Run tests
run: go test -race -vet=off ./...
working-directory: ./github-actions/cleanup-packages/
- name: Delete Versions
if: github.ref == 'refs/heads/main'
run: go run ./cmd/cleanup/main.go
env:
PAT_CONTAINER_REGISTRY: ${{ secrets.PAT_CONTAINER_REGISTRY }}
working-directory: ./github-actions/cleanup-packages/