diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef7f2cd..182cecd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,13 +19,20 @@ jobs: uses: actions/checkout@v2 with: token: ${{ secrets.PAT }} - + - name: Log in to the Docker hub run: docker login -u ${{secrets.DOCKER_USER}} -p ${{secrets.DOCKER_PASS}} + - name: Get file version + id: get-version + run: | + VERSION=$(cat image-captioning/version.txt) + echo "File version: $VERSION" + echo "::set-output name=version::$VERSION" + - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: push: false - tags: image-captioning-fed-server:latest + tags: image-captioning-fed-server:${{ steps.get-version.outputs.version }} github-token : ${{ secrets.PAT }} diff --git a/Dockerfile b/Dockerfile index ef866e6..8abfe52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ COPY image-captioning/requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt +COPY . . + # # Stage 2: Runtime environment # FROM python:3.9-slim diff --git a/image-captioning/version.txt b/image-captioning/version.txt new file mode 100644 index 0000000..0aa8850 --- /dev/null +++ b/image-captioning/version.txt @@ -0,0 +1 @@ +v1.0.0-beta \ No newline at end of file