diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 40838145c..608177738 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -18,7 +18,24 @@ concurrency: preview-${{ github.ref }} jobs: build-docs: runs-on: ubuntu-latest + # Use custom docs CI image + container: ghcr.io/juaml/junifer-docs:main steps: + - name: Check ANTs + run: | + echo "Using ANTs : $(antsRegistration --version)" + - name: Install system dependencies + run: | + # actions/checkout fails to identify Git as it's not in the CI image + apt-get -qq update && \ + apt-get -qq install -y \ + git \ + git-annex \ + make \ + jq + # Copy xfms directory + mkdir -p $HOME/junifer/data/xfms && \ + cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/ - name: Checkout source uses: actions/checkout@v4 with: @@ -28,36 +45,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Check for sudo - shell: bash + - name: Install Python dependencies run: | - if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi - echo "SUDO=$SUDO" >> $GITHUB_ENV - - name: Install dependencies - run: | - $SUDO bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)" - $SUDO apt-get update -qq - $SUDO apt-get install git-annex-standalone python -m pip install --upgrade pip setuptools wheel python -m pip install -e ".[docs,neurokit2]" - - name: Configure git for datalad + - name: Configure Git for DataLad run: | - git config --global user.email "runner@github.com" - git config --global user.name "GITHUB CI Runner" - - name: Install ANTs - run: | - echo "++ Add universe repo" - sudo add-apt-repository -y universe - - echo "++ Update package manager info" - sudo apt-get update -qq - - echo "++ Downloading ANTs" - curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.1/ants-2.5.1-ubuntu-22.04-X64-gcc.zip - unzip ants.zip -d /opt - mv /opt/ants-2.5.1/bin/* /opt/ants-2.5.1 - rm ants.zip - echo "/opt/ants-2.5.1" >> $GITHUB_PATH + git config --global user.email "junifer-runner@github.com" + git config --global user.name "GitHub Runner" - name: Test build docs run: | BUILDDIR=_build/main make -C docs/ local diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7b3860869..7ec6b3192 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,24 @@ on: jobs: build-docs: runs-on: ubuntu-latest + # Use custom docs CI image + container: ghcr.io/juaml/junifer-docs:main steps: + - name: Check ANTs + run: | + echo "Using ANTs : $(antsRegistration --version)" + - name: Install system dependencies + run: | + # actions/checkout fails to identify Git as it's not in the CI image + apt-get -qq update && \ + apt-get -qq install -y \ + git \ + git-annex \ + make \ + jq + # Copy xfms directory + mkdir -p $HOME/junifer/data/xfms && \ + cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/ - name: Checkout source uses: actions/checkout@v4 with: @@ -23,37 +40,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Check for sudo - shell: bash + - name: Install Python dependencies run: | - if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi - echo "SUDO=$SUDO" >> $GITHUB_ENV - - name: Install dependencies - run: | - $SUDO bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)" - $SUDO apt-get update -qq - $SUDO apt-get install git-annex-standalone python -m pip install --upgrade pip setuptools wheel python -m pip install -e ".[docs,neurokit2]" python -m pip install git+https://github.com/dls-controls/sphinx-multiversion@only-arg - - name: Configure git for datalad + - name: Configure Git for DataLad run: | - git config --global user.email "runner@github.com" - git config --global user.name "GITHUB CI Runner" - - name: Install ANTs - run: | - echo "++ Add universe repo" - sudo add-apt-repository -y universe - - echo "++ Update package manager info" - sudo apt-get update -qq - - echo "++ Downloading ANTs" - curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.1/ants-2.5.1-ubuntu-22.04-X64-gcc.zip - unzip ants.zip -d /opt - mv /opt/ants-2.5.1/bin/* /opt/ants-2.5.1 - rm ants.zip - echo "/opt/ants-2.5.1" >> $GITHUB_PATH + git config --global user.email "junifer-runner@github.com" + git config --global user.name "GitHub Runner" - name: Checkout gh-pages # As we already did a deploy of gh-pages above, it is guaranteed to be there # so check it out so we can selectively build docs below diff --git a/docs/changes/newsfragments/374.misc b/docs/changes/newsfragments/374.misc new file mode 100644 index 000000000..7ba4471cb --- /dev/null +++ b/docs/changes/newsfragments/374.misc @@ -0,0 +1 @@ +Adopt usage of custom docs CI image for building and previewing docs actions by `Synchon Mandal`_