| 1 |
name: Publish documentation |
| 2 |
|
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- develop |
| 8 |
paths: |
| 9 |
- docs/mkdocs/** |
| 10 |
- docs/examples/** |
| 11 |
workflow_dispatch: |
| 12 |
|
| 13 |
|
| 14 |
concurrency: |
| 15 |
group: documentation |
| 16 |
cancel-in-progress: false |
| 17 |
|
| 18 |
permissions: |
| 19 |
contents: read |
| 20 |
|
| 21 |
jobs: |
| 22 |
publish_documentation: |
| 23 |
permissions: |
| 24 |
contents: write |
| 25 |
|
| 26 |
if: github.repository == 'nlohmann/json' |
| 27 |
runs-on: ubuntu-22.04 |
| 28 |
steps: |
| 29 |
- name: Harden Runner |
| 30 |
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf |
| 31 |
with: |
| 32 |
egress-policy: audit |
| 33 |
|
| 34 |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 35 |
|
| 36 |
- name: Install virtual environment |
| 37 |
run: make install_venv -C docs/mkdocs |
| 38 |
|
| 39 |
- name: Build documentation |
| 40 |
run: make build -C docs/mkdocs |
| 41 |
|
| 42 |
- name: Deploy documentation |
| 43 |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e |
| 44 |
with: |
| 45 |
github_token: ${{ secrets.GITHUB_TOKEN }} |
| 46 |
publish_dir: ./docs/mkdocs/site |