-
Notifications
You must be signed in to change notification settings - Fork 217
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
20eae7e
commit 683bec8
Showing
1 changed file
with
19 additions
and
18 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 |
---|---|---|
|
@@ -11,29 +11,30 @@ permissions: # This sets permissions for all jobs | |
actions: read | ||
|
||
jobs: | ||
docs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: List docs directory | ||
run: ls -l ./docs | ||
- name: Display requirements.txt | ||
run: cat ./docs/requirements.txt | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r ./docs/requirements.txt | ||
pip freeze | ||
- name: Sphinx build | ||
pip install sphinx | ||
- name: Build documentation | ||
run: | | ||
sphinx-build -b html docs/source/ . # Change the output directory to root of the workspace | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/xiaoyi_doc' }} | ||
with: | ||
publish_branch: xiaoyi_doc # Deploy directly to xiaoyi_doc | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./ # Set publish directory to the root of the branch | ||
force_orphan: true | ||
sphinx-build -b html ./docs/source/ ./ # Build directly into the root of the working directory | ||
- name: Commit files | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
git add -A | ||
git commit -m "Deploy documentation updates [skip ci]" || echo "No changes to commit" | ||
git push origin HEAD:xiaoyi_doc |