-
Notifications
You must be signed in to change notification settings - Fork 711
62 lines (60 loc) · 1.57 KB
/
publish_docs.yaml
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
name: Publish APIs
on:
push:
branches:
- '*release*'
- 'release/**'
pull_request:
branches:
- 'main'
- 'master'
- '*release*'
- 'release/**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
if: "contains(toJSON(github.event.commits.*.message), '[run doc]')"
runs-on: ubuntu-20.04
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7.7
architecture: x64
- name: Build Scala APIs
run: |
sbt doc
- name: Install PyPI dependencies
run: |
python -m pip install --upgrade pip
cd ./python/docs && pip install -r requirements_doc.txt
- name: Build Python APIs
run: |
cd ./python/docs
make html
- name: Commit changes
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "github-actions"
git add --all
if [-z "$(git status --porcelain)"]; then
echo "::set-output name=push::false"
else
git commit -m "Update Scala and Python APIs" -a
echo "::set-output name=push::true"
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}