forked from pytorch/xla
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 1.99 KB
/
_docs.yml
File metadata and controls
71 lines (71 loc) · 1.99 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
name: xla-docs-build
on:
workflow_call:
inputs:
dev-image:
required: true
type: string
description: Base image for builds
runner:
required: false
type: string
description: Runner type for the test
default: linux.4xlarge
secrets:
torchxla-bot-token:
required: true
jobs:
build-docs:
runs-on: ubuntu-latest
timeout-minutes: 45
container:
image: ${{ inputs.dev-image }}
env:
BRANCH_NAME: ${{ github.ref_name }}
steps:
- name: Fetch wheels
uses: actions/download-artifact@v4
with:
name: torch-xla-wheels
path: /tmp/wheels/
- name: Install wheels
shell: bash
run: |
pip install /tmp/wheels/*.whl
- name: Checkout PyTorch/XLA Repo
uses: actions/checkout@v4
with:
path: pytorch/xla
- name: Build docs
shell: bash
run: |
cd pytorch/xla/docs
pip install -r requirements.txt
sphinx-build -b html source build
- name: Checkout GitHub Pages
uses: actions/checkout@v4
with:
path: gh-pages
ref: gh-pages
token: ${{ github.event_name == 'push' && secrets.torchxla-bot-token || github.token }}
- name: Merge changes
shell: bash
run: |
subdir=${{ env.BRANCH_NAME == 'master' && 'master' || format('{0}/{1}', 'release', env.BRANCH_NAME) }}
mkdir -p gh-pages/$subdir
cp -fR pytorch/xla/docs/build/* gh-pages/$subdir
- name: Upload preview as artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: pytorch/xla/docs/build/
- name: Deploy
shell: bash
run: |
cd gh-pages
git config user.email "pytorchxla@gmail.com"
git config user.name "torchxlabot2"
git add . -v
git diff --cached --exit-code || git commit -m "Update doc from commit ${{ github.sha }}"
git push origin gh-pages
if: github.event_name == 'push'