From 61a694e1d4244cb7fcbabf84695a4a114f658f62 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 6 Nov 2020 08:51:28 +0530 Subject: [PATCH] Add the current version to a file when building. --- .github/workflows/docker-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d7915eb..5beab32 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -28,6 +28,8 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Get hash of latest image run: docker pull python:3-alpine && docker inspect --format='{{index .RepoDigests 0}}' python:3-alpine > dockerhash.txt + - name: Write the current version to a file + run: "{ git describe --tags --abbrev=0 & date +\"%d-%m-%y\" & git rev-list HEAD --max-count=1 --abbrev-commit;} > version.txt" - name: cache docker cache uses: actions/cache@v2.1.2 with: @@ -65,6 +67,8 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Get hash of latest image run: docker pull pypy:3-slim-buster && docker inspect --format='{{index .RepoDigests 0}}' pypy:3-slim-buster > dockerhash.txt + - name: Write the current version to a file + run: "{ git describe --tags --abbrev=0 & date +\"%d-%m-%y\" & git rev-list HEAD --max-count=1 --abbrev-commit;} > version.txt" - name: cache docker cache uses: actions/cache@v2.1.2 with: