Skip to content

Commit 5c6f43d

Browse files
chore: set build arg for publishing version (#74)
1 parent fa8c23a commit 5c6f43d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: .github/workflows/docker-publish.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,22 @@ name: Docker
77

88
on:
99
schedule:
10-
- cron: '27 0 * * *'
10+
- cron: "27 0 * * *"
1111
push:
12-
branches: [ "main" ]
12+
branches: ["main"]
1313
# Publish semver tags as releases.
14-
tags: [ 'v*.*.*' ]
14+
tags: ["v*.*.*"]
1515
pull_request:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717

1818
env:
1919
# Use docker.io for Docker Hub if empty
2020
REGISTRY: ghcr.io
2121
# github.repository as <account>/<repo>
2222
IMAGE_NAME: ${{ github.repository }}
2323

24-
2524
jobs:
2625
build:
27-
2826
runs-on: ubuntu-latest
2927
permissions:
3028
contents: read
@@ -43,7 +41,7 @@ jobs:
4341
if: github.event_name != 'pull_request'
4442
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
4543
with:
46-
cosign-release: 'v2.2.4'
44+
cosign-release: "v2.2.4"
4745

4846
# Set up BuildKit Docker container builder to be able to build
4947
# multi-platform images and export cache
@@ -82,6 +80,8 @@ jobs:
8280
cache-from: type=gha
8381
cache-to: type=gha,mode=max
8482
platforms: linux/amd64,linux/arm64
83+
build-args:
84+
VERSION: ${{ github.ref_name }}
8585

8686
# Sign the resulting Docker image digest except on PRs.
8787
# This will only write to the public Rekor transparency log when the Docker

Diff for: Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG VERSION="dev"
22

33
FROM golang:1.23.7 AS build
4+
# allow this step access to build arg
5+
ARG VERSION
46
# Set the working directory
57
WORKDIR /build
68
# Copy the current directory contents into the working directory

0 commit comments

Comments
 (0)