Skip to content

Commit b551cb3

Browse files
metasimecheipesh
authored andcommitted
GitHub actions build.
1 parent 05b4c44 commit b551cb3

6 files changed

Lines changed: 64 additions & 7 deletions

File tree

.circleci/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/disabled-workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
container:
16-
image: s22s/circleci-openjdk-conda-gdal:b8e30ee
16+
image: s22s/debian-openjdk-conda-gdal:d7e065d
1717

1818
steps:
1919
- uses: actions/checkout@v2

.github/image/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!requirements-conda.txt
3+
!fix-permissions

.github/image/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM adoptopenjdk/openjdk11:debian-slim
2+
3+
# See: https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html
4+
RUN \
5+
apt-get update && \
6+
apt-get install -yq gpg && \
7+
curl -s https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
8+
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
9+
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \
10+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list && \
11+
apt-get update && \
12+
apt-get install -yq --no-install-recommends conda && \
13+
apt-get clean && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
ENV CONDA_DIR=/opt/conda
17+
ENV PATH=$CONDA_DIR/bin:$PATH
18+
19+
COPY requirements-conda.txt /tmp
20+
RUN \
21+
conda install --quiet --yes --channel=conda-forge --file=/tmp/requirements-conda.txt && \
22+
echo "$CONDA_DIR/lib" > /etc/ld.so.conf.d/conda.conf && \
23+
ldconfig && \
24+
conda clean --all --force-pkgs-dirs --yes --quiet
25+
26+
# Work-around for pyproj issue https://github.com/pyproj4/pyproj/issues/415
27+
ENV PROJ_LIB=/opt/conda/share/proj
28+

.github/image/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
IMAGE_NAME=debian-openjdk-conda-gdal
2+
SHA=$(shell git log -n1 --format=format:"%H" | cut -c 1-7)
3+
VERSION?=$(SHA)
4+
HOST=docker.io
5+
REPO=$(HOST)/s22s
6+
FULL_NAME=$(REPO)/$(IMAGE_NAME):$(VERSION)
7+
8+
.DEFAULT_GOAL := help
9+
help:
10+
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
11+
@echo "Usage: make [target]"
12+
@echo "Targets: "
13+
@grep -E '^[a-zA-Z0-9_%/-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\t\033[36m%-20s\033[0m %s\n", $$1, $$2}'
14+
15+
all: build push ## Build and then push image
16+
17+
build: ## Build the docker image
18+
docker build . -t ${FULL_NAME}
19+
20+
login: ## Login to the docker registry
21+
docker login
22+
23+
push: login ## Push docker image to registry
24+
docker push ${FULL_NAME}
25+
26+
run: build ## Build image and launch shell
27+
docker run --rm -it ${FULL_NAME} bash
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python==3.8
2+
gdal==3.1.2
3+
libspatialindex
4+
rasterio[s3]
5+
rtree

0 commit comments

Comments
 (0)