Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker image specification and continuous delivery #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Build and publish container image"

on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "[0-9]+.[0-9]+.[0-9]+*"


env:
REGISTRY: "ghcr.io"
IMAGE_NAME: "${{ github.repository_owner }}/pdgstaging"
IMAGE_TAG: "${{ github.ref_type == 'tag' && github.ref_name || 'latest' }}"


jobs:

build-and-release-image:
name: "Build and release container image"
runs-on: "ubuntu-latest"

permissions:
packages: "write"
attestations: "write"

steps:
- name: "Check out repository"
uses: "actions/checkout@v3"

- name: "Build container image"
run: |
docker build --tag "${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}" .

- name: "GHCR login"
uses: "docker/login-action@v2"
with:
registry: "${{ env.REGISTRY }}"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: "Push to GHCR"
run: |
docker push "${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.9-slim

# Install transitive dependencies
RUN apt-get update \
&& apt-get install -y git libspatialindex-dev libgdal-dev libproj-dev

# Install pdgstaging from GitHub repo
RUN pip install git+https://github.com/PermafrostDiscoveryGateway/viz-staging.git

WORKDIR /app

CMD ["python3"]
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
'Rtree >= 0.9, < 1.0',
'filelock >= 3.6, < 4.0',
'coloraide >= 0.10, < 1',
'colormaps == 0.4.0'
'colormaps == 0.4.0',

# Transitive dependancies below this line; we don't support breaking changes in
# these releases yet.
'pydantic < 2',
'fiona < 1.9',

],
python_requires='>=3.9, <4.0',
classifiers=[
Expand Down