Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,33 @@ jobs:
id: meta
run: |
# For a release-triggered workflow, GITHUB_REF_NAME is the tag name (e.g., v0.2.3)
# but we strip the leading 'v' for the Docker tag (e.g., 0.2.3)
echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build and push
- name: Build and push base image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.tag }}
${{ env.DOCKER_IMAGE }}:latest

- name: Build and push image with data
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/add_data.dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.tag }}-with-data
${{ env.DOCKER_IMAGE }}:latest-with-data

publish-pypi:
name: Publish sdist to PyPI
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions docker/add_data.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM antsx/antspynet:latest

USER root
WORKDIR /home/antspyuser

RUN . "${VIRTUAL_ENV}/bin/activate" && \
/opt/bin/download_antsxnet_data.py \
--cache-dir /home/antspyuser/.keras/ANTsXNet \
--strict && \
chmod -R 0755 /home/antspyuser/.antspy /home/antspyuser/.keras

USER antspyuser

LABEL maintainer="Philip A Cook (https://github.com/cookpa)" \
description="ANTsPyNet is part of the ANTsX ecosystem (https://github.com/ANTsX). \
ANTsX citation: https://pubmed.ncbi.nlm.nih.gov/33907199"
ENTRYPOINT ["python"]