Skip to content

Commit

Permalink
ci: Create GitHub Actions workflow to build and deploy documentation
Browse files Browse the repository at this point in the history
- Create new GitHub Actions workflow for building GitHub Pages
- Added GitHub Pages workflow to build and deploy Sphinx documentation
- Configured workflow to run on pushes to the "main" branch
- Deployed built documentation to GitHub Pages using `github-pages-deploy-action`
  • Loading branch information
Lei00764 committed Dec 11, 2024
1 parent f077e9c commit 43bfa4d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: GitHub Pages

on:
push:
branches: ["main"]

# 权限
permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install -e .[docs]
- name: Build Sphinx documentation
run: |
sphinx-build -b html docs build
# 创建 .nojekyll 文件以允许下划线开头的文件夹
touch build/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build

0 comments on commit 43bfa4d

Please sign in to comment.