Skip to content

[CI] Fix wrong folder name when deploying doc #9

[CI] Fix wrong folder name when deploying doc

[CI] Fix wrong folder name when deploying doc #9

name: Build and Deloy Documentation
on:
push:
branches: ["dev", "maint-*"]
pull_request:
branches: ["dev", "maint-*"]
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'
BRANCH_NAME: "PR-${{ github.event.number }}"
jobs:
build-and-deploy-doc:
runs-on:
- self-hosted
- Linux
- doc
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: false
- name: Build documentation
run: |
make env.conda
source ~/miniconda3/etc/profile.d/conda.sh
conda activate "${{ github.workspace }}"/env
make doc
- name: Deploy documentation
run: |
echo "${GITHUB_REF}"
echo "${PR_NUMBER}"
echo "${{ github.ref_name }}"
echo "${{ github.head_ref }}"
if [[ ! -z "${{ github.event_number }}" ]];
then
BRANCH_NAME="${{ github.ref_name }}"
fi
mv site "${BRANCH_NAME}"
ls "${BRANCH_NAME}"
scp -r "${BRANCH_NAME}" "aramislab:/srv/local/clinica/docs/public/${BRANCH_NAME}"