diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..ef72bcfa --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,34 @@ +name: Docker Build and Publish Image +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + env: + DOCKER_IMAGE: sybila/parasim + steps: + - name: Checkout the code + uses: actions/checkout@v2 + - name: Prepare + id: prepare + run: | + echo ::set-output name=docker_image::${DOCKER_IMAGE} + echo ::set-output name=release_tag::${{ github.event.release.tag_name }} + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build Docker image + run: | + docker build \ + --tag ${{ steps.prepare.outputs.docker_image }}:latest \ + --tag ${{ steps.prepare.outputs.docker_image }}:${{ github.event.release.tag_name }} \ + . + - name: Publish Docker image + # Only deploy if using master on original repo (and not for pull requests or forks) + if: github.repository_owner == 'sybila' && github.ref == 'refs/heads/master' + run: | + docker push --all-tags ${{ steps.prepare.outputs.docker_image }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fe76f89e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Download base image ubuntu 16.04 +FROM ubuntu:16.04 +MAINTAINER Matej Trojak + +# Install dependencies +RUN apt-get update +RUN apt-get install -y wget software-properties-common + +# Install Octave +RUN apt-add-repository ppa:octave/stable +RUN apt-get update +RUN apt-get install -y octave + +# Install miniconda +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh +RUN /bin/bash ~/miniconda.sh -b -p /opt/conda +ENV PATH="/opt/conda/bin:$PATH" + +# Install Java +RUN conda install -c conda-forge openjdk=8.0.332 + +# Install Parasim +COPY . parasim/ +WORKDIR parasim +RUN ./gradlew installDist +ENV PATH="/parasim/application/build/install/parasim/bin:$PATH" \ No newline at end of file diff --git a/README.markdown b/README.markdown index 5c95354c..89bd1510 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,5 @@ +[![Docker Pulls](https://badgen.net//docker/pulls/sybila/parasim?icon=docker)](https://hub.docker.com/r/sybila/parasim/) + # Parasim Parasim is a tool for robustness analysis. For information not covered in this README visit the [Parasim wiki](https://github.com/sybila/parasim/wiki).