Skip to content

Commit

Permalink
Merge pull request #8 from UNDP-Data/feat/cicd
Browse files Browse the repository at this point in the history
fix cicd
  • Loading branch information
iferencik authored Nov 10, 2023
2 parents 2b0d946 + b261d33 commit 8876261
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
contents: read
packages: write


steps:
# - name: Checkout repository
# uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
Expand All @@ -32,6 +33,16 @@ jobs:
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
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -41,5 +52,3 @@ jobs:
push: ${{ github.ref == 'refs/heads/main'}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secret-files: |
"GDAL_RIO=../gdal_rio.env"
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libffi-dev python3-pip
RUN python3 -m pip install pipenv
WORKDIR /opt/server
RUN export PYTHON_VERSION="$(python3 --version | cut -d ' ' -f 2)" && pipenv --python ${PYTHON_VERSION}
RUN pipenv run pip install -U pip
RUN pipenv run pip install uvicorn titiler asyncpg postgis --no-cache-dir --upgrade


WORKDIR /opt/server

COPY src/cogserver cogserver
COPY gdal_rio.env .

CMD pipenv run uvicorn cogserver:app --host ${HOST} --port ${PORT}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
# Enable the following volumes if you want to mount source code to Docker
# volumes:
# - "./app/wmts.py:/opt/wmts/wmts.py"
env_file:
- gdal_rio.env
# env_file:
# - gdal_rio.env
ports:
- 8000:80
# environment:
Expand Down
2 changes: 1 addition & 1 deletion gdal_rio.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ PYTHONWARNINGS=ignore
VSI_CACHE=TRUE
VSI_CACHE_SIZE=5000000
## rio-tiler config
RIO_TILER_MAX_THREADS=2
RIO_TILER_MAX_THREADS=1

0 comments on commit 8876261

Please sign in to comment.