Skip to content

Commit b227274

Browse files
authored
Update and rename pythonpackage.yml to master.yml
1 parent 6df8200 commit b227274

1 file changed

Lines changed: 35 additions & 6 deletions

File tree

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
33
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
44

5-
name: spatialmath-python
5+
name: CI
66

77
on:
88
push:
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
# Run tests on different versions of python
15-
tests:
15+
unittest:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
@@ -39,11 +39,10 @@ jobs:
3939
run: |
4040
pytest
4141
42-
deploy:
42+
codecov:
4343
# If all tests pass:
4444
# Run coverage and upload to codecov
45-
# Build docs
46-
needs: tests
45+
needs: unittest
4746
runs-on: ubuntu-latest
4847
steps:
4948
- uses: actions/checkout@v2
@@ -63,4 +62,34 @@ jobs:
6362
uses: codecov/codecov-action@v1
6463
with:
6564
file: ./.coverage
66-
65+
sphinx:
66+
# If the above worked:
67+
# Build docs and upload to GH Pages
68+
needs: unittest
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v2
72+
- name: Build docs
73+
run: |
74+
cd docs
75+
make html
76+
# Tell GitHub not to use jekyll to compile the docs
77+
touch build/html/.nojekyll
78+
cd ../
79+
- name: Commit documentation changes
80+
run: |
81+
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
82+
cp -r docs/build/html/* gh-pages/
83+
cd gh-pages
84+
git config --local user.email "action@github.com"
85+
git config --local user.name "GitHub Action"
86+
git add .
87+
git commit -m "Update documentation" -a || true
88+
# The above command will fail if no changes were present, so we ignore
89+
# that.
90+
- name: Push changes
91+
uses: ad-m/github-push-action@master
92+
with:
93+
branch: gh-pages
94+
directory: gh-pages
95+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)