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

Deploy #16

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
60 changes: 60 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker build and publish

on:
push:
branches: [ master ]

concurrency:
# We want all containers to be pushed. Don't cancel any concurent jobs.
group: '${{ github.workflow }} @ ${{ github.sha}}'
cancel-in-progress: true

jobs:
docker:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get short sha
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Generate image metadata
id: meta
uses: docker/metadata-action@v5
env:
# We build multiplatform images which have an image index above the
# image manifests. Attach the annotations directly to the image index.
DOCKER_METADATA_ANNOTATIONS_LEVELS: "index"

- name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
target: runtime
platforms: linux/amd64,linux/arm64
push: true
# We have to explicitly add the "qlever:latest" tag for it to work correctly,
# see e.g. https://stackoverflow.com/questions/27643017/do-i-need-to-manually-tag-latest-when-pushing-to-docker-public-repository
tags: >
adfreiburg/qlever-petrimaps:latest,
adfreiburg/qlever-petrimaps:${{ github.ref_name }},
adfreiburg/qlever-petrimaps:commit-${{ steps.sha.outputs.sha_short }},

# Set Annotations and Labels that conform to the OpenContainers
# Annotations Spec
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}

17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04 AS builder

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -22,6 +22,19 @@ ADD web /web

RUN mkdir build && cd build && cmake .. && make -j8

FROM ubuntu:24.04 AS runtime

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /
RUN apt update &&\
apt install -y --no-install-recommends \
ca-certificates \
xxd \
libgomp1 \
libpng-dev \
libcurl4-gnutls-dev &&\
rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/petrimaps /petrimaps

ENTRYPOINT ["./build/petrimaps"]
ENTRYPOINT ["/petrimaps"]