Skip to content

Commit c7bb78f

Browse files
authored
Add GitHub actions to test environments and Publish docker images (#1)
1 parent e82c5e8 commit c7bb78f

File tree

4 files changed

+67
-6
lines changed

4 files changed

+67
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Create Docker images
2+
3+
on:
4+
push:
5+
tags: "*"
6+
7+
jobs:
8+
create_docker:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
conda-config: [release]
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Publish to Registry
19+
uses: elgohr/Publish-Docker-Github-Action@v4
20+
with:
21+
name: ${{ github.repository }}/${{ matrix.conda-config }}:${{ github.ref_name }}
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
dockerfile: ${{ matrix.conda-config }}.dockerfile
25+
registry: ghcr.io
26+
snapshot: true

.github/workflows/create-env.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Create the environment
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
conda-config: [release]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- uses: mamba-org/setup-micromamba@v2
21+
with:
22+
environment-file: envs/${{ matrix.conda-config }}.yml
23+
init-shell: >-
24+
bash
25+
cache-environment: true
26+
cache-downloads: true
27+
post-cleanup: "all"
28+
29+
- name: Test for import
30+
run: python -c "import genomicranges"
31+
shell: bash -el {0}
32+
33+
- name: Snapshot the package versions in the environment
34+
run: pip list
35+
shell: micromamba-shell {0}

envs/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: biocpy_devel
1+
name: biocpy_release
22
channels:
33
- conda-forge
44
dependencies:

release.dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM condaforge/miniforge3:latest
1+
FROM mambaorg/micromamba:2.0.5
22

3-
WORKDIR /biocenv
4-
COPY . /biocenv
5-
RUN mamba --version
3+
COPY --chown=$MAMBA_USER:$MAMBA_USER envs/release.yml /tmp/env.yaml
4+
RUN micromamba --version
65

7-
RUN mamba env create -f env/release.yml
6+
RUN micromamba install -y -n base -f /tmp/env.yaml && \
7+
micromamba clean --all --yes

0 commit comments

Comments
 (0)