Skip to content

Update GHA and bump to version 2.5.0.2 #15

Update GHA and bump to version 2.5.0.2

Update GHA and bump to version 2.5.0.2 #15

Workflow file for this run

# Continuous integration testing for ChRIS Plugin.
# https://github.com/FNNDSC/python-chrisapp-template/wiki/Continuous-Integration
name: build
on:
push:
branches: [ main ]
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
# QEMU is used for non-x86_64 builds
- uses: docker/setup-qemu-action@v3
# buildx adds additional features to docker build
- uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Login to DockerHub
if: github.event_name == 'push' && contains(steps.meta.outputs.tags, 'docker.io')
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
if: github.event_name == 'push' && contains(steps.meta.outputs.tags, 'ghcr.io')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# linux/ppc64le not working, see https://github.com/ANTsX/ANTs/issues/1644
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create README.md
run: |
echo '${{ github.server_url }}/${{ github.repository }}' > README.md
- name: Update DockerHub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
short-description: ChRIS plugin wrapper for N4BiasFieldCorrection
- name: Get preferred tag
id: preferred
if: github.ref_type == 'tag'
run: |
echo '${{ fromJSON(steps.meta.outputs.json).tags }}' \
| jq -r 'map(select(startswith("ghcr.io") and (endswith("latest") | not))).[0]' \
| xargs printf "tag=%s\n" \
| tee --append "$GITHUB_OUTPUT"
outputs:
image: ${{ steps.preferred.outputs.tag }}
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
steps:
- name: Upload ChRIS Plugin
uses: FNNDSC/upload-chris-plugin@main
with:
dock_image: ${{ needs.build.outputs.image }}
username: ${{ secrets.CHRISPROJECT_USERNAME }}
password: ${{ secrets.CHRISPROJECT_PASSWORD }}
chris_url: https://cube.chrisproject.org/api/v1/
compute_names: NERC