From 2209a65d52e2a0b432f0cd52fb7ef9e61d796591 Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Sun, 25 Jul 2021 13:20:38 -0400 Subject: [PATCH] Adding automated docker version tag for stable releases - Added set to parse version to x.x.x format for tag. (This is the same way we parse for sentry release maps) - Added additional build and push step for docker with parse version as tag. --- .github/workflows/stable-docker.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stable-docker.yml b/.github/workflows/stable-docker.yml index 6dfed1b30..cbf5c14c6 100644 --- a/.github/workflows/stable-docker.yml +++ b/.github/workflows/stable-docker.yml @@ -30,7 +30,7 @@ jobs: rsync -a dist/ ../../API/wwwroot/ cd ../ || exit - + - name: Get csproj Version uses: naminodarie/get-net-sdk-project-versions-action@v1 id: get-version @@ -38,7 +38,15 @@ jobs: proj-path: Kavita.Common/Kavita.Common.csproj - name: Echo csproj version - run: echo "${{steps.get-version.outputs.assembly-version}}" + run: echo "${{steps.get-version.outputs.assembly-version}}" + + - name: Parse Version + run: | + version='${{steps.get-version.outputs.assembly-version}}' + newVersion=${version%.*} + echo $newVersion + echo "::set-output name=VERSION::$newVersion" + id: parse-version - name: Compile dotnet app uses: actions/setup-dotnet@v1 @@ -75,6 +83,15 @@ jobs: push: true tags: kizaing/kavita:latest + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + tags: kizaing/kavita:${{ steps.parse-version.outputs.VERSION }} + - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}