forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (74 loc) · 2.07 KB
/
_cache.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
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
name: Cache prime (docker)
permissions:
contents: read
on:
workflow_call:
secrets:
app-id:
required: true
app-key:
required: true
inputs:
arch:
type: string
default: x64
cache-suffix:
type: string
default:
image-tag:
type: string
required: true
request:
type: string
required: true
runs-on:
type: string
default: ubuntu-24.04
lock-repository:
type: string
default: envoyproxy/ci-mutex
## Docker cache
#
# This workflow will only prime the cache, and should be done separately first, prior
# to any jobs that require it.
#
# For a job that does, you can restore with something like:
#
# steps:
# - uses: envoyproxy/toolshed/gh-actions/docker/cache/[email protected]
# with:
# key: "${{ needs.env.outputs.build-image }}"
#
jobs:
docker:
runs-on: ${{ inputs.runs-on || 'ubuntu-24.04' }}
steps:
- uses: envoyproxy/toolshed/gh-actions/[email protected]
id: appauth
name: Appauth (mutex lock)
with:
app_id: ${{ secrets.app-id }}
key: ${{ secrets.app-key }}
- uses: envoyproxy/toolshed/gh-actions/docker/cache/[email protected]
id: docker
name: Prime Docker cache (${{ inputs.image-tag }}${{ inputs.cache-suffix }})
with:
image-tag: ${{ inputs.image-tag }}
key-suffix: ${{ inputs.cache-suffix }}
lock-token: ${{ steps.appauth.outputs.token }}
lock-repository: ${{ inputs.lock-repository }}
- uses: envoyproxy/toolshed/gh-actions/[email protected]
id: data
name: Cache data
with:
input-format: yaml
input: |
cached: ${{ steps.docker.outputs.cached }}
key: ${{ inputs.image-tag }}${{ inputs.cache-suffix }}
- uses: envoyproxy/toolshed/gh-actions/json/[email protected]
name: Summary
with:
json: ${{ steps.data.outputs.value }}
output-path: GITHUB_STEP_SUMMARY
title: >-
Cache (Docker ${{ inputs.arch }})