Skip to content

Commit

Permalink
GitHub actions docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed May 29, 2021
1 parent 95bf5b2 commit 205a073
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/manubot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ jobs:
with:
# fetch entire commit history to support get_rootstock_commit
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: build
tags: |
${{ github.repository_owner }}/manubot:latest
- name: Set Environment Variables
run: |
TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA}
Expand All @@ -37,13 +53,13 @@ jobs:
key: ci-cache-${{ github.ref }}
restore-keys: |
ci-cache-${{ env.DEFAULT_BRANCH_REF }}
- name: Install Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: manubot
environment-file: build/environment.yml
auto-activate-base: false
miniconda-version: 'latest'
# - name: Install Environment
# uses: conda-incubator/setup-miniconda@v2
# with:
# activate-environment: manubot
# environment-file: build/environment.yml
# auto-activate-base: false
# miniconda-version: 'latest'
- name: Install Spellcheck
shell: bash --login {0}
run: |
Expand Down
16 changes: 16 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM condaforge/miniforge3:latest

ARG CONDA_PREFIX=/opt/conda
ARG CONDA_ENV=manubot

COPY environment.yml /
RUN conda env create \
--prefix=$CONDA_PREFIX/envs/$CONDA_ENV \
--file=/environment.yml \
&& conda clean --all --force-pkgs-dirs --yes

ENV PATH $CONDA_PREFIX/envs/$CONDA_ENV/bin:$PATH
RUN echo "conda activate $CONDA_ENV" > ~/.bashrc
RUN /bin/bash -c "conda activate $CONDA_ENV"

ENV CONDA_DEFAULT_ENV=$CONDA_ENV

0 comments on commit 205a073

Please sign in to comment.