dockerize #2
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
name: dockerize | |
run-name: dockerize | |
on: | |
push: | |
# only build+push docker on release-please tags | |
# TODO | |
#tags: ["v*"] | |
branches: ["test-ci"] | |
paths: | |
- ".github/actions/**" | |
- ".github/workflows/**" | |
- "conda-recipe/**" | |
- "genome_kit/**" | |
- "setup.py" | |
- "setup/**" | |
- "src/**" | |
- "tests/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-gk | |
with: | |
platform: linux-64 | |
docker-build: | |
needs: build | |
runs-on: linux-64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: get meta.yaml from conda-forge for cache key calculation | |
uses: ./.github/actions/curl-meta-yaml | |
- name: restore mamba env | |
id: restore_mamba_cache | |
uses: actions/cache/restore@v4 | |
with: | |
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/dockerize.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/dockerize.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: ~/micromamba/envs/build/envs | |
file: Dockerfile | |
# TODO | |
#push: true | |
push: false | |
tags: | | |
deepgenomicsinc/genomekit:latest | |
deepgenomicsinc/genomekit:latest-py310 | |
deepgenomicsinc/genomekit:${{ steps.create-gk-env.outputs.PGK_VERSION }}-py310 |