Skip to content

Commit

Permalink
add version to CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
janf committed Nov 14, 2023
1 parent d6e85b9 commit 5b69e86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,20 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Titiler version
- uses: actions/setup-python@v4
with:
python-version: '3.10'
run: python -m pip install titiler && echo "TITILER_VERSION=$(python -c 'from titiler.application import __version__;print(__version__)')" >> $GITHUB_ENV
#echo "GITHUB_SHA_SHORT=$(python -c 'from src/cogserver')" >> $GITHUB_ENV
#run: python my_script.py
- name: Echo Titiler version
run: echo "za tit versions is {{ env.TITILER_VERSION }}"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# - name: Copy .env file
# run: cp "gdal_rio.env" gdal_rio.env

# - name: Read gdal_rio.env file and set environment variables
# run: |
# while IFS= read -r line;
# do
# export $(echo "$line" | grep -v '^#' | xargs)
# done < gdal_rio.env

images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TITILER_VERSION }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand Down
3 changes: 2 additions & 1 deletion src/cogserver/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .server import app
from cogserver.server import app
from cogserver.server import titiler_version as __version__

0 comments on commit 5b69e86

Please sign in to comment.