Skip to content

Commit 205a073

Browse files
committed
GitHub actions docker build
1 parent 95bf5b2 commit 205a073

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

.github/workflows/manubot.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ jobs:
2121
with:
2222
# fetch entire commit history to support get_rootstock_commit
2323
fetch-depth: 0
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
- name: Docker login
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Build and push
33+
id: docker_build
34+
uses: docker/build-push-action@v2
35+
with:
36+
push: true
37+
context: build
38+
tags: |
39+
${{ github.repository_owner }}/manubot:latest
2440
- name: Set Environment Variables
2541
run: |
2642
TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA}
@@ -37,13 +53,13 @@ jobs:
3753
key: ci-cache-${{ github.ref }}
3854
restore-keys: |
3955
ci-cache-${{ env.DEFAULT_BRANCH_REF }}
40-
- name: Install Environment
41-
uses: conda-incubator/setup-miniconda@v2
42-
with:
43-
activate-environment: manubot
44-
environment-file: build/environment.yml
45-
auto-activate-base: false
46-
miniconda-version: 'latest'
56+
# - name: Install Environment
57+
# uses: conda-incubator/setup-miniconda@v2
58+
# with:
59+
# activate-environment: manubot
60+
# environment-file: build/environment.yml
61+
# auto-activate-base: false
62+
# miniconda-version: 'latest'
4763
- name: Install Spellcheck
4864
shell: bash --login {0}
4965
run: |

build/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM condaforge/miniforge3:latest
2+
3+
ARG CONDA_PREFIX=/opt/conda
4+
ARG CONDA_ENV=manubot
5+
6+
COPY environment.yml /
7+
RUN conda env create \
8+
--prefix=$CONDA_PREFIX/envs/$CONDA_ENV \
9+
--file=/environment.yml \
10+
&& conda clean --all --force-pkgs-dirs --yes
11+
12+
ENV PATH $CONDA_PREFIX/envs/$CONDA_ENV/bin:$PATH
13+
RUN echo "conda activate $CONDA_ENV" > ~/.bashrc
14+
RUN /bin/bash -c "conda activate $CONDA_ENV"
15+
16+
ENV CONDA_DEFAULT_ENV=$CONDA_ENV

0 commit comments

Comments
 (0)