62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: Sphinx Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
#- dev
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ammaraskar/sphinx-action@master
|
|
with:
|
|
docs-folder: "src_docs/"
|
|
pre-build-command: |
|
|
pip install --upgrade pip
|
|
pip install sphinx==4.3.2
|
|
pip install docutils==0.16
|
|
pip install pygments==2.11.1
|
|
pip install furo==2022.1.2
|
|
pip install sphinx-copybutton
|
|
pip list
|
|
build-command: "sphinx-build -b html ./source ../docs"
|
|
|
|
- name: Commit documentation changes
|
|
run: |
|
|
pwd
|
|
ls -al
|
|
ls -al docs
|
|
git clone https://github.com/mp-se/gravitymon.git --branch ghpages --single-branch ghpages
|
|
mkdir -p ghpages/docs
|
|
cp -r docs/* ghpages/docs
|
|
cd ghpages
|
|
touch docs/.nojekyll
|
|
git config --local user.email "action@noreply.github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add .
|
|
git commit -m "Update documentation" -a || true
|
|
|
|
- uses: wangyucode/sftp-upload-action@v1.4.8
|
|
with:
|
|
host: ${{ secrets.SFTP_HOST }}
|
|
port: 22
|
|
username: ${{ secrets.SFTP_USER }}
|
|
password: ${{ secrets.SFTP_PASSWD }}
|
|
forceUpload: false
|
|
localDir: 'docs/'
|
|
remoteDir: '/run/www/docs/'
|
|
exclude: ''
|
|
dryRun: false
|
|
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
branch: ghpages
|
|
directory: ghpages
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|