-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.04 KB
/
buildx-pull.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
name: buildx-pull
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Buildx pull
id: cache
uses: ./buildx-pull/
with:
images: |
registry.hub.docker.com/library/alpine:3.15
registry.hub.docker.com/library/alpine:3.16
- name: Check registry-addr
run: test "${{ steps.cache.outputs.registry-addr }}" = "localhost:5000"
- name: Check buildx-opts
env:
BUILDX_OPTS: ${{ steps.cache.outputs.buildx-opts }}
run: |
n=0
for opt in ${BUILDX_OPTS}; do
echo "image: ${opt}"
if ! [[ ${opt} == --cache-from=localhost:5000/cache-* ]]; then
echo "Wrong format" >&2
exit 1
fi
image=$(echo "${opt}" | sed 's/^--cache-from=//')
docker pull ${image}
n=$((n + 1))
done
test ${n} -eq 2