Skip to content

Commit d5fc6b5

Browse files
authored
Merge pull request #994 from pytorch/update-publishing-yml
Separate doc build to avoid publising docs on PR
2 parents dbcd905 + 74abf23 commit d5fc6b5

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

.github/workflows/doc-build.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Doc Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
9+
jobs:
10+
build_docs_job:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.6]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Dependencies
19+
run: |
20+
echo `python3 --version`
21+
sudo apt-get install -y python-setuptools
22+
sudo apt-get install -y python3-sphinx
23+
python3 -m pip install --upgrade pip
24+
python3 -m pip install setuptools
25+
id: build
26+
- name: Build the docset
27+
run: |
28+
cd docs
29+
pip install -r requirements.txt
30+
make html
31+
- name: Get output time
32+
run: echo "The time was ${{ steps.build.outputs.time }}"
33+
- name: Deploy
34+
uses: JamesIves/github-pages-deploy-action@releases/v3
35+
with:
36+
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
BRANCH: gh-pages # The branch the action should deploy to.
38+
FOLDER: ./docs/build/html # The folder the action should deploy.

.github/workflows/main.yml

-30
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,3 @@ jobs:
3939
title: Daily CI failed
4040
body: Commit ${{ github.sha }} daily scheduled [CI run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed, please check why
4141
assignees: ''
42-
43-
build_docs_job:
44-
runs-on: ubuntu-latest
45-
strategy:
46-
matrix:
47-
python-version: [3.6]
48-
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v2
51-
- name: Dependencies
52-
run: |
53-
echo `python3 --version`
54-
sudo apt-get install -y python-setuptools
55-
sudo apt-get install -y python3-sphinx
56-
python3 -m pip install --upgrade pip
57-
python3 -m pip install setuptools
58-
id: build
59-
- name: Build the docset
60-
run: |
61-
cd docs
62-
pip install -r requirements.txt
63-
make html
64-
- name: Get output time
65-
run: echo "The time was ${{ steps.build.outputs.time }}"
66-
- name: Deploy
67-
uses: JamesIves/github-pages-deploy-action@releases/v3
68-
with:
69-
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
BRANCH: gh-pages # The branch the action should deploy to.
71-
FOLDER: ./docs/build/html # The folder the action should deploy.

0 commit comments

Comments
 (0)