-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2de22d
commit 7d5b307
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: API Auto Update # The name of the workflow indicates its purpose to automatically update the API documentation. | ||
|
||
on: # Defines the events that trigger the workflow. | ||
push: | ||
branches: ["main", "dev"] # This workflow is triggered by pushes to the 'dev' branch. | ||
workflow_dispatch: # This allows the workflow to be manually triggered. | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: # Defines a job called 'deploy'. | ||
runs-on: ubuntu-latest # Specifies the virtual environment where the job will run. | ||
|
||
steps: # Defines a list of steps to be executed. | ||
- name: Checkout # Step to checkout the repository's code. | ||
uses: actions/checkout@v4 # Uses the actions/checkout action to access the repository code. | ||
|
||
- name: Configure GitHub Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Cache pip # Step to cache pip packages. | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies # Step to install dependencies. | ||
run: | | ||
pip install sphinxcontrib-matlabdomain sphinx-immaterial | ||
- name: Generate Sphinx Documentation for API Documentation # Step to generate Sphinx documentation. | ||
run: | | ||
python docs/api/update_RTM_rst.py | ||
sphinx-build -b html docs/api/sphinx_src docs/api | ||
- name: Upload artifact # Step to upload the built site as an artifact. | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/api | ||
|
||
- name: Deploy to GitHub Pages # Step to deploy to GitHub Pages. | ||
id: deployment | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
publish_branch: gh-pages # Specifies the branch to deploy to. | ||
github_token: ${{ secrets.GITHUB_TOKEN }} # Authenticates using a GitHub Token. | ||
publish_dir: ./docs/api # Specifies the directory to deploy. |