Skip to content

[CI] Move build and deploy to GitHub Actions #10

[CI] Move build and deploy to GitHub Actions

[CI] Move build and deploy to GitHub Actions #10

name: Build and Deloy Handbook
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
POETRY_VERSION: '1.6.1'
PYTHON_VERSION: '3.10'
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
build-and-deploy:
runs-on:
- self-hosted
- Linux
- gpu
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: false
- uses: actions/cache@v2
with:
path: /local2/ci/miniconda3/envs/clinicadl_handbook
key: ${{ env.CACHE_NUMBER }}-conda-${{ hashFiles('environment.yml') }}
id: cache
- name: Update environment
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda env update -n clinicadl_handbook -f environment.yml
if: steps.cache.outputs.cache-hits != 'true'
- name: Build documentation
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate clinicadl_handbook
make install
make build.notebooks
make build.book
sed -i 's+github/aramis-lab/clinicadl_handbook/blob/main/jupyter-book/notebooks+github/aramis-lab/clinicadl_handbook/blob/main/notebooks+g' ./jupyter-book/_build/html/notebooks/*.html
- name: Deploy documentation
run: |
ls jupyter-book/_build/html
scp -r jupyter-book/_build/html aramislab:/srv/local/clinicadl/tutoriel/2023/