remiceres triggered production documentation build on develop #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Sphinx: Render production docs" | |
| run-name: ${{ github.actor }} triggered production documentation build on ${{ github.ref_name }} | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: | |
| - "Publish Development Pre-release" | |
| - "Publish GitHub Release" | |
| types: | |
| - completed | |
| concurrency: | |
| group: sphinx-prod | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-production-docs: | |
| if: > | |
| github.event_name != 'workflow_run' || | |
| github.event.workflow_run.conclusion == 'success' | |
| runs-on: [self-hosted, corese-stack-ubuntu-24] | |
| env: | |
| DOCS_SOURCE_REF: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.DOCS_SOURCE_REF }} | |
| - name: Show documentation source ref | |
| run: | | |
| echo "event_name=${{ github.event_name }}" | |
| echo "docs_source_ref=${DOCS_SOURCE_REF}" | |
| git rev-parse HEAD | |
| - name: Check existing tags before fetch | |
| run: git tag --sort=-v:refname || echo "No tags found" | |
| - name: Delete all local tags to avoid conflicts | |
| run: git tag -d $(git tag) || echo "No tags to delete" | |
| - name: Fetch updated tags | |
| run: git fetch --prune --tags --force | |
| - name: Check tags after fetch | |
| run: git tag --sort=-v:refname || echo "No tags found after fetch" | |
| - name: Build Sphinx documentation with multiversion | |
| env: | |
| DOCS_BASE_URL: https://corese-stack.github.io/corese-gui | |
| MINIMAL_VERSION: 5.0.0 | |
| run: | | |
| source /builds/miniconda3/etc/profile.d/conda.sh | |
| conda activate corese-core-documentation | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| sphinx-build docs/source build/html/main | |
| else | |
| sphinx-multiversion docs/source build/html | |
| fi | |
| chmod +x docs/switcher_generator.sh | |
| ./docs/switcher_generator.sh build/html/switcher.json build/html/index.html | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./build/html | |
| keep_files: true |