Skip to content

Development/cmake enhancements #216

Development/cmake enhancements

Development/cmake enhancements #216

# Inspiration: https://github.com/ACCESS-Hive/access-hive.github.io/pull/126
# For security, we do not want to checkout and run code from forks (could lead to secrets being leaked)
# So split documentation build/preview into discrete steps
name: Build documentation preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
# Only run when we change files in docs directory
paths:
- 'docs/**'
concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true
jobs:
build-preview:
if: ${{ github.event.action != 'closed' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs build
- run: echo "${{ github.event.number }}" >> ./site/.pr_number
- name : Upload preview site artifact
uses : actions/upload-artifact@v4
with:
name: preview_site
path: ./site
retention-days: 1
clean-preview:
if: ${{ github.event.action == 'closed' }}
runs-on: ubuntu-latest
steps:
- run: mkdir pr_tmp
- run: echo "${{ github.event.number }}" >> ./pr_tmp/.pr_number
- uses : actions/upload-artifact@v4
with:
name: closed_pr_number
path: ./pr_tmp
retention-days: 1