-
Notifications
You must be signed in to change notification settings - Fork 65
50 lines (50 loc) · 1.61 KB
/
docker.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
name: Docker
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/metadata-action@v5
id: docker-meta
with:
images: cloudflare/origin-ca-issuer
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- uses: actions/cache@v4
id: cache
with:
path: |
go-pkg-mod
root-cache-go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: reproducible-containers/buildkit-cache-dance@v3
with:
cache-map: |
{
"go-pkg-mod": "/go/pkg/mod",
"root-cache-go-build": "/root/.cache/go-build"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- uses: docker/build-push-action@v5
with:
file: ./cmd/controller/Dockerfile
platforms: linux/amd64, linux/arm64
sbom: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
cache-from: type=gha
cache-to: type=gha,mode=max