-
Notifications
You must be signed in to change notification settings - Fork 1
170 lines (152 loc) · 6.05 KB
/
Copy pathimages.yaml
File metadata and controls
170 lines (152 loc) · 6.05 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Container Image Build and Push
on:
release:
types: [created]
push:
tags:
- 'v*'
# On PRs, the jobs below run in build-only mode (push: false, single-arch)
# so a broken Dockerfile or build context is caught before a release tag.
pull_request:
branches: [main]
permissions:
contents: read
packages: write
id-token: write
env:
REGISTRY: ghcr.io
HUB_IMAGE_NAME: ${{ github.repository }}-hub
AGENT_IMAGE_NAME: ${{ github.repository }}-agent
jobs:
build-and-push-hub-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.HUB_IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./deploy/Dockerfile.hub
# Multi-arch on release; single-arch build-only on PRs (no QEMU emulation cost).
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
GIT_COMMIT=${{ github.sha }}
BUILD_DATE=${{ github.event.release.created_at }}
# PR-only validation that every provider Dockerfile + build context still
# builds, before the split sync ever reaches a mirror. Each provider is a
# self-contained build context (providers/<name>/). These builds are NEVER
# pushed here — provider images are published per-provider, stamped with the
# provider's own version, by provider-release.yaml on a `providers/<name>/v*`
# tag. (Publishing here would tag provider images with the hub version.)
build-and-push-provider-images:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- name: quickstart
image: ${{ github.repository_owner }}/kedge-quickstart-provider
- name: infrastructure
image: ${{ github.repository_owner }}/kedge-infrastructure-provider
- name: code
image: ${{ github.repository_owner }}/kedge-code-provider
- name: kuery
image: ${{ github.repository_owner }}/kedge-kuery-provider
- name: app-studio
image: ${{ github.repository_owner }}/kedge/app-studio-provider
- name: databricks
image: ${{ github.repository_owner }}/kedge-databricks-provider
# Companion image of the infrastructure provider (the dev-agent its
# kro backend injects into development-mode pods); published by
# provider-release.yaml on the infrastructure provider's tag.
- name: infrastructure/dev-agent
image: ${{ github.repository_owner }}/kedge-dev-agent
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ matrix.image }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./providers/${{ matrix.name }}
file: ./providers/${{ matrix.name }}/Dockerfile
# Multi-arch on release; single-arch build-only on PRs (no QEMU emulation cost).
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-and-push-agent-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./deploy/Dockerfile.agent
# Multi-arch on release; single-arch build-only on PRs (no QEMU emulation cost).
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
GIT_COMMIT=${{ github.sha }}
BUILD_DATE=${{ github.event.release.created_at }}