Added version management sysytem

This commit is contained in:
Lalit Sudhir
2025-10-19 02:03:04 -07:00
parent ddeebc8142
commit b3ab445538
5 changed files with 429 additions and 3 deletions

View File

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