Skip to content

Commit

Permalink
Build docker image in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobMiksch committed Jul 6, 2024
1 parent 212f0c1 commit 6294af8
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and Push Docker Image

on:
push:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Install Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/src/qsa-api/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# QSA REST API : installation

From sources:
## From sources

```` shell
$ cd qsa-api
Expand All @@ -10,6 +10,6 @@ $ . venv/bin/activate
(venv)$ poetry install
````

Binary distributions:
## Docker image

TODO : provide a docker image on Dockerhub
A prebuilt image can be found on `ghcr.io/pblottiere/qsa`. Otherwise the image can be manually be built using: `docker build -t my-custom-qsa-image .` See [Sandbox](sandbox/) for details how to use it.
2 changes: 1 addition & 1 deletion sandbox/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
image: pblottiere/qsa
build:
context: ..
dockerfile: sandbox/Dockerfile
dockerfile: Dockerfile
volumes:
- ./dem.tif:/dem.tif
- ./data.gpkg:/data.gpkg
Expand Down

0 comments on commit 6294af8

Please sign in to comment.