diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..25bfe68 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +# +name: Create and publish a Docker image + +on: + release: + types: [published, prereleased] + push: + branches: + - main + - master + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Log in to the Container registry + uses: docker/login-action@v3.4.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.7.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=tag + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v6.18.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..04fd209 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:stable AS builder + +RUN apt-get update && apt-get install -y \ + git \ + build-essential \ + zlib1g-dev \ + libbz2-dev \ + liblzma-dev \ + libcurl4-openssl-dev \ + ca-certificates \ + libomp-dev + +COPY . /usr/src +WORKDIR /usr/src +RUN make -j8 + +FROM debian:stable-slim + +RUN apt-get update && apt-get install -y \ + procps \ + libgomp1 \ + samtools + +COPY --from=builder /usr/src/bin/* /usr/local/bin/