forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (74 loc) · 2.72 KB
/
docs.yaml
File metadata and controls
76 lines (74 loc) · 2.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build Docs
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown yapf numpy tensorflow fastai
pip install -e .
- name: Debug head ref
run: git rev-parse --abbrev-ref HEAD
- name: Build docs
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
run: |
cd docs
python generate.py
- name: REF
run: echo '${{ github.ref }}'
- name: Upload docs
uses: actions/upload-artifact@master
with:
name: "docs"
path: docs/markdown
- name: Git status
run: |
git status
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v2.5.0
with:
commit_message: "Doc updates"
branch: ${{ github.head_ref }}
file_pattern: "*.md"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_API_TOKEN }}
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
- name: "Download docs"
uses: actions/download-artifact@master
with:
name: docs
path: generated_docs
- name: "Print what's here"
run: ls -al
- name: "Push to gitbook"
uses: ./.github/actions/commit-docs
with:
repo: https://github.com/wandb/gitbook.git
author_name: Chris Van Pelt
author_email: vanpelt@wandb.com
force: false
path: "."
pattern: "library/reference/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_API_TOKEN }}