148 even more doc updates #2
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: PR docs preview | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
permissions: | |
contents: write | |
pull-requests: write | |
concurrency: preview-${{ github.ref }} | |
jobs: | |
build-and-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install system deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen graphviz | |
python3 -m pip install --upgrade pip | |
python3 -m pip install mkdocs mkdocs-material pymdown-extensions | |
- name: Build docs | |
run: make clean document | |
- name: Deploy PR preview (subdir) | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: site | |
destination_dir: pr-preview/pr-${{ github.event.number }} | |
keep_files: true | |
enable_jekyll: false | |
- name: Comment preview URL on PR | |
uses: actions/github-script@v7 | |
env: | |
PREVIEW_URL: https://pecanproject.github.io/sipnet/pr-preview/pr-${{ github.event.number }}/ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const owner = context.repo.owner; | |
const repo = context.repo.repo; | |
const pr_number = context.payload.pull_request.number; | |
const url = process.env.PREVIEW_URL; | |
const body = `Preview: ${url}`; | |
await github.rest.issues.createComment({ owner, repo, issue_number: pr_number, body }); |