add image version

This commit is contained in:
qiaofeng1227 2023-07-06 10:26:07 +08:00
parent c7a87c1245
commit b5af8258ba
2 changed files with 8 additions and 3 deletions

View File

@ -9,8 +9,6 @@ jobs:
build-image:
name: Build Docker image
runs-on: ubuntu-latest
env:
TAGS: latest
steps:
- uses: actions/checkout@v2
name: Check out code
@ -30,12 +28,18 @@ jobs:
echo "::set-output name=appmanage_changed::false"
fi
- name: Get version
if: ${{ steps.check_changes.outputs.appmanage_changed == 'true' }}
run: |
version=$(grep -Po '(?<=LABEL version=").*?(?=")' appmanage/Dockerfile)
echo "::set-output name=version::$version"
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image
if: ${{ steps.check_changes.outputs.appmanage_changed == 'true' }}
with:
image: websoft9dev/appmanage
tags: 0.7.2
tags: ${{ steps.get_version.outputs.version }}
registry: docker.io
dockerfile: appmanage/Dockerfile
directory: appmanage

View File

@ -1,5 +1,6 @@
FROM python:3.10-slim
LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="0.7.3"
# Create API Directory
WORKDIR /usr/src/app