Added version management sysytem
This commit is contained in:
24
.github/workflows/build-and-publish.yml
vendored
24
.github/workflows/build-and-publish.yml
vendored
@@ -4,10 +4,15 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
docker-build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
@@ -18,9 +23,24 @@ jobs:
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: |
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_without_v=${VERSION#v}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "version=latest" >> $GITHUB_OUTPUT
|
||||
echo "version_without_v=latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: bentopdf/bentopdf:latest
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
bentopdf/bentopdf:latest
|
||||
bentopdf/bentopdf:${{ steps.version.outputs.version_without_v }}
|
||||
bentopdf/bentopdf:${{ steps.version.outputs.version }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
Reference in New Issue
Block a user