-
Notifications
You must be signed in to change notification settings - Fork 179
81 lines (69 loc) · 2.64 KB
/
cache-benchmark.yml
File metadata and controls
81 lines (69 loc) · 2.64 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Cache Benchmark
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/databuddy-analytics/databuddy
jobs:
gha-cache:
name: "GHA cache (links, amd64)"
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Mount Docker build cache
uses: useblacksmith/stickydisk@41873b1513bb679f9c115504cbd13d3660432504 # v1
with:
key: ${{ github.repository }}-cache-bench-gha
path: /tmp/docker-build-cache
- name: Set up Docker Builder
uses: useblacksmith/setup-docker-builder@ac083cc84672d01c60d5e8561d0a939b697de542 # v1
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build with GHA cache
uses: useblacksmith/build-push-action@cbd1f60d194a98cb3be5523b15134501eaf0fbf3 # v2
with:
context: .
file: links.Dockerfile
push: false
platforms: linux/amd64
tags: bench:gha-cache
cache-from: type=gha,scope=bench-gha
cache-to: type=gha,mode=max,scope=bench-gha
registry-cache:
name: "Registry cache (links, amd64)"
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Mount Docker build cache
uses: useblacksmith/stickydisk@41873b1513bb679f9c115504cbd13d3660432504 # v1
with:
key: ${{ github.repository }}-cache-bench-registry
path: /tmp/docker-build-cache
- name: Set up Docker Builder
uses: useblacksmith/setup-docker-builder@ac083cc84672d01c60d5e8561d0a939b697de542 # v1
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build with registry cache
uses: useblacksmith/build-push-action@cbd1f60d194a98cb3be5523b15134501eaf0fbf3 # v2
with:
context: .
file: links.Dockerfile
push: false
platforms: linux/amd64
tags: bench:registry-cache
cache-from: type=registry,ref=${{ env.IMAGE_PREFIX }}-links:cache-bench
cache-to: type=registry,ref=${{ env.IMAGE_PREFIX }}-links:cache-bench,mode=max