Skip to content

Commit 1b8c05e

Browse files
authored
Merge pull request #3117 from infrahq/mxyng/fix-build-args
fix: add build-args back to docker image build
2 parents 1cf5bf3 + 19e94dc commit 1b8c05e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/cd-containers.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
2626
outputs:
2727
components: ${{ steps.components.outputs.components }}
28+
release-name: ${{ steps.release-name.outputs.release-name }}
2829
steps:
30+
- uses: actions/checkout@v3
2931
- id: components
3032
run: |
3133
COMPONENT_NAME=$(echo ${{ github.event_name == 'workflow_run' && github.event.workflow_run.name || inputs.component-name }} | awk '{ print $NF }')
@@ -36,6 +38,10 @@ jobs:
3638
esac
3739
3840
echo "::set-output name=components::$COMPONENTS"
41+
- id: release-name
42+
run: |
43+
RELEASE_NAME=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe --tags)' }}
44+
echo "::set-output name=release-name::${RELEASE_NAME#v}"
3945
4046
build:
4147
runs-on: ubuntu-latest
@@ -68,6 +74,9 @@ jobs:
6874
context: ${{ env.CONTEXT }}
6975
push: true
7076
platforms: linux/amd64,linux/arm64
77+
build-args: |
78+
BUILDVERSION=${{ needs.prepare.outputs.release-name }}
79+
TELEMETRY_WRITE_KEY=${{ secrets.TELEMETRY_WRITE_KEY }}
7180
tags: ${{ steps.metadata.outputs.tags }}
7281
labels: ${{ steps.metadata.outputs.labels }}
7382
cache-from: type=registry,ref=${{ env.IMAGE }}:edge

.goreleaser.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ builds:
1313
-X github.com/infrahq/infra/internal.Version={{ .Version }}
1414
-X github.com/infrahq/infra/internal.Commit={{ .FullCommit }}
1515
-X github.com/infrahq/infra/internal.Date={{ .Date }}
16+
-X github.com/infrahq/infra/internal.Prerelease=
17+
-X github.com/infrahq/infra/internal.Metadata=
1618
binary: infra
1719
main: ./main.go
1820
goos:

0 commit comments

Comments
 (0)