Skip to content

Commit

Permalink
Merge pull request #374 from juaml/chore/docs-ci-image-upgrade
Browse files Browse the repository at this point in the history
[CI]: Adopt custom CI image for junifer docs
  • Loading branch information
synchon authored Oct 14, 2024
2 parents 88aa7a9 + e816c55 commit 429f5f1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 52 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -28,36 +45,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check for sudo
shell: bash
run: |
if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi
echo "SUDO=$SUDO" >> $GITHUB_ENV
- name: Install dependencies
- name: Install Python 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 "[email protected]"
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 "[email protected]"
git config --global user.name "GitHub Runner"
- name: Test build docs
run: |
BUILDDIR=_build/main make -C docs/ local
Expand Down
47 changes: 21 additions & 26 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -23,37 +40,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Check for sudo
shell: bash
run: |
if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi
echo "SUDO=$SUDO" >> $GITHUB_ENV
- name: Install dependencies
- name: Install Python 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 "[email protected]"
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 "[email protected]"
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
Expand Down
1 change: 1 addition & 0 deletions docs/changes/newsfragments/374.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adopt usage of custom docs CI image for building and previewing docs actions by `Synchon Mandal`_

0 comments on commit 429f5f1

Please sign in to comment.