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

Docker image continuous delivery #32

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 }}/pdgraster"
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}"
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.10-slim

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

# Add source
WORKDIR /app
ADD . .

# Install pdgraster from source
RUN pip install .

CMD ["python"]
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "pdgraster"
version = "0.9.2"
description = "Geospatial data rasterization workflow"
description = "Rasterization to GeoTiff and web-based tiles for the PDG Visualization pipeline"
authors = [
"Robyn Thiessen-Bock <[email protected]>",
"Juliet Cohen <[email protected]>",
Expand Down Expand Up @@ -32,6 +32,7 @@ colormaps = "== 0.4.0"
Pillow = ">= 9, < 10"
rasterio = ">= 1.2, < 2"
pydantic = "1.10.9"
pdgstaging = { git="https://github.com/PermafrostDiscoveryGateway/viz-staging.git" }

[tool.poetry.group.dev.dependencies]
pytest = ">=7"
Expand Down
40 changes: 0 additions & 40 deletions setup.py

This file was deleted.