Skip to content

Commit

Permalink
Add github workflow to push to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
andylassiter committed Jul 31, 2024
1 parent 48958b1 commit 1e7aa3b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/docker-image-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker Image CI

on:
push:
tags:
- 'v*'
branches:
- develop

jobs:

build-and-push:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
images: |
xnat/tnbc-pdx-segmentation
tags: |
type=raw,value=latest,event=tag,enable=${{ startsWith(github.ref, 'refs/tags/v') && ! contains(github.ref, 'rc') && ! contains(github.ref, 'beta') && ! contains(github.ref, 'alpha') }}
type=semver,pattern={{version}},event=tag,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=develop,event=push,enable=${{ github.ref == format('refs/heads/{0}', 'develop') }}
labels: |
org.opencontainers.image.title=Mice Image Splitter
org.opencontainers.image.description=Split multi-subject PET/CT mice images into individual subject images
- 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@v5
with:
context: .
push: true
platforms: linux/amd64 # ,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM xnat/tensorflow-notebook:JHP-76
FROM xnat/tensorflow-notebook:develop

USER root

Expand Down

0 comments on commit 1e7aa3b

Please sign in to comment.