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.
This commit is contained in:
Robbie Davis 2021-07-25 13:20:38 -04:00
parent d97e81d53e
commit 2209a65d52

View File

@ -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 }}