-
Notifications
You must be signed in to change notification settings - Fork 251
102 lines (89 loc) · 2.73 KB
/
docs.yml
File metadata and controls
102 lines (89 loc) · 2.73 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Build and Deploy Documentation
on:
push:
branches:
- main
- docs-website
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for versioning
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Install AITER (for autodoc)
run: |
# Install minimal dependencies for doc build
# (ROCm not needed for documentation generation)
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e . || true # Continue even if full install fails
- name: Build Sphinx documentation
run: |
cd docs
make html
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/html/
retention-days: 7
deploy-docs:
needs: build-docs
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs-website')
permissions:
contents: write # For GitHub Pages deployment
steps:
- name: Download documentation artifacts
uses: actions/download-artifact@v4
with:
name: documentation
path: ./html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html
cname: doc.aiter.amd.com # Custom domain
commit_message: 'docs: deploy documentation'
# Alternative: Deploy to AMD servers via SSH
# deploy-to-amd:
# needs: build-docs
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
#
# steps:
# - name: Download documentation artifacts
# uses: actions/download-artifact@v4
# with:
# name: documentation
# path: ./html
#
# - name: Deploy to AMD doc server
# uses: easingthemes/ssh-deploy@v4
# with:
# SSH_PRIVATE_KEY: ${{ secrets.AMD_DOC_SERVER_KEY }}
# REMOTE_HOST: doc.aiter.amd.com
# REMOTE_USER: deploy
# SOURCE: "html/"
# TARGET: "/var/www/doc.aiter.amd.com/html"