Skip to content

Commit

Permalink
Merge pull request #96 from lubronzhan/topic/lubron/fix-95
Browse files Browse the repository at this point in the history
Add VERSION variable to publish and release job
  • Loading branch information
lubronzhan authored Jan 22, 2024
2 parents 3b3a4a4 + c00645a commit 2d552c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
uses: docker/login-action@v3
with:
username: kubevip
password: ${{ secrets.DOCKERHUB_KUBEVIP_TOKEN }}
Expand All @@ -37,5 +37,7 @@ jobs:
kubevip/kube-vip-cloud-provider:latest,
ghcr.io/kube-vip/kube-vip-cloud-provider:${{ github.ref_name }},
ghcr.io/kube-vip/kube-vip-cloud-provider:latest
build-args: |
VERSION=${{ github.ref_name }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/root/.local/share/golang \

ARG VERSION

ENV LD_FLAGS="-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=$VERSION -s"
ENV LD_FLAGS="-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=$VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.local/share/golang \
Expand Down

0 comments on commit 2d552c0

Please sign in to comment.