-
Notifications
You must be signed in to change notification settings - Fork 4
112 lines (107 loc) · 3.65 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: build
on:
pull_request:
paths:
- .github/workflows/build.yaml
- .github/workflows/e2e-test.yaml
- Dockerfile
- entrypoint.sh
- e2e-test/**
push:
paths:
- .github/workflows/build.yaml
- .github/workflows/e2e-test.yaml
- Dockerfile
- entrypoint.sh
- e2e-test/**
branches:
- main
tags:
- '*'
env:
RUNNER_VERSION: 2.307.0
jobs:
image:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
packages: write
outputs:
image-uri: ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}
steps:
- uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
id: metadata
with:
images: ghcr.io/${{ github.repository }}
- uses: int128/docker-build-cache-config-action@ad84c9c54c01578e767b17eae930bf1c9ae6dc46 # v1.15.0
id: cache
with:
image: ghcr.io/${{ github.repository }}/cache
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
- uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
- uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
id: build
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}
build-args: |
RUNNER_VERSION=${{ env.RUNNER_VERSION }}
platforms: |
linux/amd64
linux/arm64
e2e-test:
needs: image
uses: ./.github/workflows/e2e-test.yaml
secrets: inherit
with:
runner-image-uri: ${{ needs.image.outputs.image-uri }}
image-ubuntu20:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
packages: write
outputs:
image-uri: ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}
steps:
- uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
id: metadata
with:
images: ghcr.io/${{ github.repository }}
flavor: suffix=-ubuntu20
- uses: int128/docker-build-cache-config-action@ad84c9c54c01578e767b17eae930bf1c9ae6dc46 # v1.15.0
id: cache
with:
image: ghcr.io/${{ github.repository }}/cache
flavor: suffix=-ubuntu20
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
- uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
- uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
id: build
with:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}
build-args: |
RUNNER_VERSION=${{ env.RUNNER_VERSION }}
BASE_IMAGE_OS=focal
ImageOS=ubuntu20
platforms: |
linux/amd64
linux/arm64