-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (63 loc) · 2.17 KB
/
publish-branch.yaml
File metadata and controls
66 lines (63 loc) · 2.17 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
# Copyright The Linux Foundation and each contributor to LFX.
# SPDX-License-Identifier: MIT
---
name: Publish Container Branch
"on":
pull_request:
branches:
- main
permissions:
contents: read
jobs:
publish:
name: Publish Container
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
with:
version: v0.18.0
- name: Prepare container tag
id: container_tag
env:
HEAD_REF: "${{ github.head_ref }}"
run: |
container_tag=$(echo "$HEAD_REF" | sed 's/[^_0-9a-zA-Z]/-/g' | cut -c -127)
echo tag="$container_tag" >> "$GITHUB_OUTPUT"
- name: Build lfx-v1-sync-helper for PR
env:
VERSION: ${{ steps.container_tag.outputs.tag }}
GIT_COMMIT: ${{ github.sha }}
run: |
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
export BUILD_TIME
GIT_COMMIT=${GIT_COMMIT:0:7}
export GIT_COMMIT
ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/lfx-v1-sync-helper \
-B \
--platform linux/amd64,linux/arm64 \
-t ${{ github.sha }} \
-t ${{ steps.container_tag.outputs.tag }} \
--sbom spdx
- name: Build dynamodb-stream-consumer for PR
env:
VERSION: ${{ steps.container_tag.outputs.tag }}
GIT_COMMIT: ${{ github.sha }}
run: |
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
export BUILD_TIME
GIT_COMMIT=${GIT_COMMIT:0:7}
export GIT_COMMIT
ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/dynamodb-stream-consumer \
-B \
--platform linux/amd64,linux/arm64 \
-t ${{ github.sha }} \
-t ${{ steps.container_tag.outputs.tag }} \
--sbom spdx