2020-08-07 10:49:27 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9.0-beta.4 - 3.9.0
|
|
|
|
|
2020-08-07 16:09:43 +02:00
|
|
|
- name: Install Sphinx
|
2020-08-07 10:49:27 +02:00
|
|
|
run: python -m pip install Sphinx
|
|
|
|
|
2020-08-07 16:55:16 +02:00
|
|
|
- name: Configure git
|
2020-08-07 10:49:27 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-08-07 16:09:43 +02:00
|
|
|
run: |
|
|
|
|
git config user.email mcsinyx@disroot.org
|
|
|
|
git config user.name Nguyễn\ Gia\ Phong
|
|
|
|
git remote set-url origin \
|
|
|
|
https://token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY
|
2020-08-07 16:55:16 +02:00
|
|
|
git fetch origin gh-pages
|
2020-08-07 10:49:27 +02:00
|
|
|
|
2020-08-07 16:09:43 +02:00
|
|
|
- name: Build and Deploy
|
2020-08-07 10:49:27 +02:00
|
|
|
run: |
|
2020-08-07 16:09:43 +02:00
|
|
|
tmpdir=$(mktemp --directory)
|
|
|
|
make html
|
|
|
|
mv --target-directory=$tmpdir doctrees html
|
|
|
|
|
|
|
|
git switch gh-pages
|
|
|
|
git rm -r doctrees html
|
|
|
|
mv --target-directory=. $tmpdir/{doctrees,html}
|
|
|
|
rm -r $tmpdir
|
|
|
|
|
|
|
|
git add doctrees html
|
|
|
|
git commit -m "Build at $(date --iso-8601=seconds)"
|
|
|
|
git push origin gh-pages
|