-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (52 loc) · 1.59 KB
/
deploy-docs.yaml
File metadata and controls
65 lines (52 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and Deploy Docs
on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed
jobs:
build-and-deploy:
if: >-
(github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main') ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Set up UV
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
working-directory: docs/hyperpocket
run: |
uv sync
- name: Build Sphinx Documentation
working-directory: docs/hyperpocket
run: |
git checkout main
uv run make clean
uv run make html
- name: Deploy to GitHub Pages
run: |
ls -al
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout gh-pages
cp -r docs/hyperpocket/_build/html/* .
rm -rf docs/hyperpocket/_build/html/
git add .
if ! git diff-index --quiet HEAD --; then
git commit -m "update"
git push --force origin gh-pages
else
echo "No changes to commit. Skipping push."
fi