Skip to content

Commit

Permalink
try build with matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Oct 9, 2020
1 parent e7ba66a commit ab71443
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
steps:
- name: checkout repo
uses: actions/checkout@v2

#------------------------------------------------------------------------#
# Check docker and conda changes
- name: check for changes
Expand All @@ -39,20 +38,17 @@ jobs:
FILES: |
Dockerfile
*.yaml
- name: test
run: |
echo ${{ matrix.env_name }}
#------------------------------------------------------------------------#
# Plot environment
# Build
- name: build docker image
if: contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/${{ matrix.env_name }}/${{ matrix.env_name }}.yaml") || contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/${{ matrix.env_name }}/Dockerfile")
run:
cd workflow/envs/${{ matrix.env_name }};
docker build --no-cache . -t ktmeaton/plague-phylogeography:${{ matrix.env_name }};

#- name: push docker image
# if: contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/plot/plot.yaml") || contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/plot/Dockerfile")
# run:
# echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin;
# docker push ktmeaton/plague-phylogeography:plot
#------------------------------------------------------------------------#
# Deploy
- name: push docker image
if: contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/${{ matrix.env_name }}/${{ matrix.env_name }}.yaml") || contains(${{ steps.git-diff.outputs.diff }}, "workflow/envs/${{ matrix.env_name }}/Dockerfile")
run:
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin;
docker push ktmeaton/plague-phylogeography:${{ matrix.env_name }}
17 changes: 17 additions & 0 deletions workflow/envs/sra/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM continuumio/miniconda3
LABEL authors="Katherine Eaton" \
description="Docker image containing dependencies for ktmeaton/plague-phylogeography: sra."
COPY plot.yaml /

# install mamba and create environment
RUN conda install -c conda-forge mamba; \
mamba env create -f /sra.yaml;

# Cleanup conda to reduce image size
RUN conda clean -a;

# Activate conda environment on login
RUN echo "source activate plague-phylogeography-sra" > ~/.bashrc;

ENV BASH_ENV ~/.bashrc
SHELL ["/bin/bash", "-c"]
1 change: 1 addition & 0 deletions workflow/envs/sra.yaml → workflow/envs/sra/sra.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: plague-phylogeography-sra
channels:
- bioconda
- conda-forge
Expand Down

0 comments on commit ab71443

Please sign in to comment.