Skip to content

Commit 79ac306

Browse files
committed
use env variable for geocoder db location
1 parent 4b007bb commit 79ac306

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/build-deploy-release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
types: [release-build, force-rebuild]
77
jobs:
88
deploy-images:
9+
environment: geocoder_release_build
910
runs-on: ubuntu-latest
1011
env:
1112
registry: ghcr.io
1213
username: ${{ github.event.organization.login || github.repository_owner }}
1314
repository: geocoder
15+
GEOCODER_S3_LOCATION: ${{ vars.GEOCODER_S3_LOCATION }}
1416
strategy:
1517
fail-fast: false
1618
steps:
@@ -27,7 +29,7 @@ jobs:
2729
echo "versioned=${versioned}" >> $GITHUB_ENV
2830
- name: build container
2931
run: |
30-
docker build -t ${{ env.container }} .
32+
docker build --build-arg GEOCODER_S3_LOCATION="${GEOCODER_S3_LOCATION}" -t ${{ env.container }} .
3133
- name: test container
3234
run: |
3335
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file.csv

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ LABEL "org.degauss.version"="${degauss_version}"
1212
LABEL "org.degauss.description"="${degauss_description}"
1313
LABEL "org.degauss.argument"="${degauss_argument}"
1414

15-
ADD https://geomarker.s3.amazonaws.com/geocoder_2021.db /opt/geocoder.db
15+
16+
# Allow S3 location to be set via build arg and env
17+
ARG GEOCODER_S3_LOCATION
18+
ENV GEOCODER_S3_LOCATION=${GEOCODER_S3_LOCATION}
19+
ADD ${GEOCODER_S3_LOCATION} /opt/geocoder.db
1620
# COPY geocoder.db /opt/geocoder.db
1721

1822
RUN apt-get update && apt-get install -y \

0 commit comments

Comments
 (0)