Skip to content

Commit

Permalink
Add docker action
Browse files Browse the repository at this point in the history
  • Loading branch information
boasvdp committed Jul 3, 2024
1 parent 8c60a99 commit dd4a790
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build_and_deploy_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow is based on part of the staphb workflow at https://github.com/StaPH-B/docker-builds/blob/master/.github/workflows/build-to-deploy.yml

name: Docker - build and deploy image

on:
workflow_dispatch:
inputs:
path_to_context:
required: true
type: string
dockerfile_name:
default: Dockerfile
required: false
type: string
ghcr_repository_name:
default: boasvdp
required: false
type: string
IMAGE_NAME:
required: true
type: string
version:
required: false
default: latest
type: string

jobs:

build:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write

steps:
- name: Check Out Repo
uses: actions/checkout@v3

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ inputs.ghcr_repository_name}}/${{ inputs.IMAGE_NAME }}
tags: |
${{ inputs.version }}
- name: Build and push to ghcr.io
id: docker_build
uses: docker/build-push-action@v3
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ steps.meta.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM condaforge/mambaforge

LABEL dockerfile.version="1"
LABEL software="skiml-cluster"

COPY environment.yml .
RUN /bin/bash -c "mamba env update -n base -f environment.yml"

RUN mkdir /variants && touch /variants/sampleA.vcf && touch /variants/sampleB.vcf && skiml-cluster run --input /variants --output /variants_output --conda-create-envs-only && rm -rf /variants
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
channels:
- conda-forge
- bioconda
dependencies:
- pip
- python=3.10
- datrie=0.8.2
- pip:
- snk==0.13.0
- pulp==2.7.0
- skiml-cluster==0.0.6

0 comments on commit dd4a790

Please sign in to comment.