[Add] Link to API documentation to Readme (#742) #27
This file contains 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: Documentation | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- v3 | |
jobs: | |
apigen: | |
runs-on: ubuntu-22.04 | |
name: ApiGen | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Run ApiGen | |
run: bin/apigen | |
- name: Upload ApiGen output artifact | |
# Require non local GitHub Actions Runner & the projects default branch | |
if: env.ACT != 'true' && ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apigen | |
path: build/apigen | |
pages: | |
runs-on: ubuntu-22.04 | |
name: GitHub Pages | |
needs: apigen | |
# Require non local GitHub Actions Runner & the projects default branch | |
if: env.ACT != 'true' && ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} | |
steps: | |
- name: Download current README | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
path: source | |
- name: Checkout GitHub Pages | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
ref: gh-pages | |
path: gh-pages | |
- name: Remove old ApiGen | |
run: rm -r gh-pages/api | |
- name: Download current ApiGen | |
uses: actions/download-artifact@v4 | |
with: | |
name: apigen | |
path: gh-pages/api | |
- name: Update GitHub Pages index from README | |
run: cp source/README.md gh-pages/index.md | |
- name: Commit & Push GitHub Pages | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actor | |
message: 'Updated GitHub Pages.' | |
cwd: gh-pages |