-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (51 loc) · 1.72 KB
/
Copy pathdocs.yml
File metadata and controls
60 lines (51 loc) · 1.72 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
name: Build and deploy documentation
permissions:
contents: write
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
# 1. Checkout your repository
- name: Checkout code
uses: actions/checkout@v4
# 2. Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# 3. Install Sphinx and dependencies
- name: Install Sphinx and dependencies
run: pip install sphinx sphinx-rtd-theme cairosvg pillow
# 4. Build Sphinx documentation
- name: Generate Sphinx docs
run: sphinx-build -b html docs docs/_build/html
# 4b. Install LaTeX and build the PDF (Yubico-style, pdflatex)
- name: Install LaTeX for PDF
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
latexmk texlive-latex-recommended texlive-latex-extra \
texlive-fonts-recommended texlive-fonts-extra tex-gyre
- name: Build PDF (pdflatex)
run: |
sphinx-build -M latexpdf docs docs/_build
cp docs/_build/latex/cryptnox-cli.pdf docs/_build/html/cryptnox-cli.pdf
# 5. Deploy HTML documentation to GitHub Pages (only on push to main)
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
publish_branch: gh-pages
allow_empty_commit: false
keep_files: false
force_orphan: false
enable_jekyll: false