Skip to content

Commit

Permalink
fix: write git version to VERSION in CI (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Sep 1, 2023
1 parent f1be9fd commit 0649cfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: "0"

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -43,6 +45,10 @@ jobs:
type=ref,event=branch
type=ref,event=pr
- name: Write "git describe --tags --dirty" to VERSION
run: |
git describe --tags --dirty | tee VERSION
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
Expand All @@ -51,3 +57,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
build-args:
version_file=VERSION
1 change: 1 addition & 0 deletions utils/docker/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ REPO=reev
git describe --tags --dirty >VERSION
sudo docker build . \
--build-arg version_file=VERSION \
--file utils/docker/Dockerfile \
--pull \
-t ghcr.io/$ORG/$REPO:$DOCKER_VERSION \
Expand Down

0 comments on commit 0649cfe

Please sign in to comment.