-
Notifications
You must be signed in to change notification settings - Fork 739
79 lines (68 loc) · 2.33 KB
/
publish_docs.yaml
File metadata and controls
79 lines (68 loc) · 2.33 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
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-22.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
uses: actions/setup-python@v4
with:
python-version: "3.8"
architecture: "x64"
- name: Install SBT
run: |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x99E82A75642AC823" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sbt.gpg > /dev/null
sudo apt-get update
sudo apt-get install -y sbt
- 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
# Run with verbose output to debug any issues
SPHINX_APIDOC_OPTIONS=members,undoc-members,show-inheritance sphinx-apidoc -e -f -o ./_api ../sparknlp ../sparknlp/tests
make html SPHINXOPTS="-v"
- 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 "push=false" >> $GITHUB_OUTPUT
else
git commit -m "Update Scala and Python APIs" -a
echo "push=true" >> $GITHUB_OUTPUT
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 }}