Skip to content

Commit

Permalink
ci: pass in app version and commit sha
Browse files Browse the repository at this point in the history
Signed-off-by: Zespre Schmidt <[email protected]>
  • Loading branch information
starbops committed Nov 17, 2024
1 parent b7e356c commit 5bdbedf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ jobs:
images: ${{ matrix.image }}
- name: Docker build and push
uses: docker/build-push-action@v6
env:
VERSION: ${{ github.ref_name }}-head
GIT_COMMIT: ${{ github.sha }}
with:
provenance: false
context: .
build-args: |
LINKFLAGS=-X main.AppVersion=${{ env.VERSION }} -X main.GitCommit=${{ env.GIT_COMMIT }}
platforms: linux/amd64,linux/arm64
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}
7 changes: 6 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ jobs:
run: make build
- name: Docker build
uses: docker/build-push-action@v6
env:
VERSION: ${{ github.event.pull_request.head.ref }}-head
GIT_COMMIT: ${{ github.sha }}
with:
provenance: false
context: .
build-args: |
LINKFLAGS=-X main.AppVersion=${{ env.VERSION }} -X main.GitCommit=${{ env.GIT_COMMIT }}
platforms: linux/amd64,linux/arm64
file: ${{ matrix.dockerfile }}
push: false
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}
7 changes: 6 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ jobs:
images: ${{ matrix.image }}
- name: Docker build and push
uses: docker/build-push-action@v6
env:
VERSION: ${{ github.ref_name }}
GIT_COMMIT: ${{ github.sha }}
with:
provenance: false
context: .
build-args: |
LINKFLAGS=-X main.AppVersion=${{ env.VERSION }} -X main.GitCommit=${{ env.GIT_COMMIT }}
platforms: linux/amd64,linux/arm64
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 5bdbedf

Please sign in to comment.