Skip to content

Fix publish docker images (#12) #14

Fix publish docker images (#12)

Fix publish docker images (#12) #14

Workflow file for this run

name: Build
on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
branches: [main]
workflow_dispatch:
env:
# Increase this to manually reset the conda environment cache
CONDA_CACHE_NUMBER: 0
YARDL_VERSION: 0.6.0
defaults:
run:
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: bash -el {0}
jobs:
build:
name: Build and Test C++17, Python, MATLAB SDKs
runs-on: ubuntu-latest
strategy:
matrix:
cppVersion: [17]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Build Environment
uses: ./.github/actions/configure-mrd-build-environment
- name: Build and Test
run: just cpp_version=${{ matrix.cppVersion }} matlab=enabled validate-with-no-changes
- name: Package MATLAB toolbox
run: just build-matlab-toolbox
- name: Store MATLAB Toolbox
uses: actions/upload-artifact@v4
with:
name: matlab-toolbox
path: matlab/release/mrd*.mltbx
overwrite: true
- name: Generate CMake FetchContent source archive
run: just build-cmake-fetch-src
- name: Store CMake FetchContent source archive
uses: actions/upload-artifact@v4
with:
name: mrd-cmake-src
path: mrd-cmake-src*.tar.gz
overwrite: true
docker:
name: Build and Publish Docker images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and test Docker images
run: |
./docker/build-images.sh
./docker/test-docker-images.sh
publishDocs:
name: Publish Documentation
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ismrmrd/mrd'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [build, docker]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up just command runner
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6
- name: Build static page
run: just build-docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/.vitepress/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
name: Publish Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build, docker]
runs-on: ubuntu-latest
environment:
name: github-release
url: https://github.com/ismrmrd/mrd/releases
permissions:
contents: write
steps:
- name: Retrieve MATLAB Toolbox
uses: actions/download-artifact@v4
with:
name: matlab-toolbox
- name: Retrieve CMake FetchContent source archive
uses: actions/download-artifact@v4
with:
name: mrd-cmake-src
- name: Generate Checksums
run: |
sha256sum mrd*.mltbx > sha256-checksums.txt
sha256sum mrd-cmake-src*.tar.gz >> sha256-checksums.txt
- name: Publish Artifacts
uses: softprops/action-gh-release@v2
with:
files: |
sha256-checksums.txt
mrd-cmake-src*.tar.gz
mrd*.mltbx
fail_on_unmatched_files: true
body: |
See also:
- [MRD Conda C++ SDK](https://anaconda.org/ismrmrd/mrd)
- [MRD Conda Python SDK](https://anaconda.org/ismrmrd/mrd-python)
- [PyPi](https://pypi.org/project/mrd-python/)
append_body: true
- name: Log into ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Push Docker images
run: ./docker/build-images.sh --tag "${GITHUB_REF_NAME}" --push