-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: publish docker image on release (#112)
- Loading branch information
Showing
4 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: dockerize | ||
run-name: dockerize | ||
on: | ||
push: | ||
# only build+push docker on release-please tags | ||
tags: ["v*"] | ||
paths: | ||
- ".github/actions/**" | ||
- ".github/workflows/**" | ||
- "conda-recipe/**" | ||
- "genome_kit/**" | ||
- "setup.py" | ||
- "setup/**" | ||
- "src/**" | ||
- "tests/**" | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/build-gk | ||
with: | ||
platform: linux-64 | ||
|
||
- name: restore mamba env | ||
id: restore_mamba_cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**') }} | ||
path: | | ||
~/micromamba | ||
~/.condarc | ||
~/bin/micromamba | ||
fail-on-cache-miss: true | ||
|
||
- name: restore the gk package tarballs | ||
id: restore_gk_pkg | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**', 'conda-recipe/meta.yaml', 'src/**', 'genome_kit/**', 'tests/**') }} | ||
path: | | ||
~/conda-bld | ||
fail-on-cache-miss: true | ||
|
||
- name: create gk env | ||
id: create-gk-env | ||
shell: bash -l -e {0} | ||
run: | | ||
set -x | ||
# explicitly select py310 | ||
pgk_file_path=$(eval ls -1 ~/conda-bld/linux-64/*py310*.tar.bz2 | head -1) | ||
pkg_file=$(basename ${pgk_file_path}) | ||
pkg_version=$(echo $pkg_file | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') | ||
echo "PKG_VERSION=${pkg_version}" >> $GITHUB_OUTPUT | ||
micromamba activate build | ||
conda index ~/conda-bld | ||
mamba create -n genomekit -c file://${HOME}/conda-bld genomekit=${pkg_version} | ||
set +x | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: /home/runner/micromamba/envs/build/envs | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
deepgenomicsinc/genomekit:latest | ||
deepgenomicsinc/genomekit:latest-py310 | ||
deepgenomicsinc/genomekit:${{ steps.create-gk-env.outputs.PKG_VERSION }}-py310 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ubuntu:22.04 | ||
COPY genomekit /opt/conda/envs/ | ||
ENV PATH=/opt/conda/envs/genomekit/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters