Skip to content

Commit bfa2d8f

Browse files
committed
feature: add ko build workflow
for publishing container images Signed-off-by: Jordan Evans <jevans@linuxfoundation.org>
1 parent 13a7d52 commit bfa2d8f

File tree

4 files changed

+75
-3
lines changed

4 files changed

+75
-3
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
name: Publish Main
5+
6+
'on':
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
publish:
17+
name: Publish Main
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version-file: go.mod
27+
- uses: ko-build/setup-ko@v0.8
28+
with:
29+
version: v0.17.1
30+
- run: |
31+
ko build github.com/linuxfoundation/lfx-v2-query-service/cmd \
32+
-B \
33+
--platform linux/amd64,linux/arm64 \
34+
-t ${{ github.sha }} \
35+
--sbom spdx
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
name: Publish Tagged Release
5+
6+
on:
7+
push:
8+
tags:
9+
- v*
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
publish:
16+
name: Publish Tagged Release
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
- uses: ko-build/setup-ko@v0.8
27+
with:
28+
version: v0.17.1
29+
- name: generate version without v
30+
id: version-no-v
31+
run: echo version="${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
32+
- run: |
33+
ko build github.com/linuxfoundation/lfx-v2-query-service/cmd \
34+
-B \
35+
--platform linux/amd64,linux/arm64 \
36+
-t ${{ github.sha }} \
37+
-t ${{ steps.version-no-v.outputs.version }} \
38+
--sbom spdx

charts/lfx-v2-query-service/templates/deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
name: query-svc
88
namespace: lfx
99
spec:
10-
replicas: {{ .Values.replicaCount }}
10+
replicas: {{ .Values.replicaCount }}
1111
selector:
1212
matchLabels:
1313
app: query-svc
@@ -19,7 +19,6 @@ spec:
1919
containers:
2020
- name: app
2121
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
22-
imagePullPolicy: Never
2322
env:
2423
- name: OPENSEARCH_URL
2524
value: {{.Values.opensearch.url}}

charts/lfx-v2-query-service/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66
# Override from CLI/CI: --set image.tag=<git-sha>, etc.
77
image:
88
tag: "0.1.0"
9-
repository: linuxfoundation/lfx-query-svc
9+
repository: ghcr.io/linuxfoundation/lfx-v2-query-service/cmd
1010

1111
# ingress is the configuration for the ingress routing
1212
ingress:

0 commit comments

Comments
 (0)