Skip to content

Commit

Permalink
Test how to add Git Tag to built docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
scadaguru committed Jul 11, 2024
1 parent 7c88e9a commit 4c7230b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: Build and push Docker image
run: |
docker login --username scadaguru --password ${{ secrets.GHCR_TOKEN }} ghcr.io
docker build . -t ghcr.io/scadaguru/test-auto-docker-build:${{ github.ref_name }} -t ghcr.io/scadaguru/test-auto-docker-build:v$(TZ="America/Chicago" date +'%Y%m%d.%H%M%S') -t ghcr.io/scadaguru/test-auto-docker-build
docker build . --build-arg GIT_TAG=${{ github.ref_name }} -t ghcr.io/scadaguru/test-auto-docker-build:${{ github.ref_name }} -t ghcr.io/scadaguru/test-auto-docker-build:v$(TZ="America/Chicago" date +'%Y%m%d.%H%M%S') -t ghcr.io/scadaguru/test-auto-docker-build
docker push ghcr.io/scadaguru/test-auto-docker-build --all-tags
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ COPY *.py /src

EXPOSE 5000

ARG GIT_TAG=unknown
LABEL version=$GIT_TAG

CMD ["python", "-u", "/src/main.py" ]

0 comments on commit 4c7230b

Please sign in to comment.