Deploy documentation using GitHub Action

This commit is contained in:
Nguyễn Gia Phong 2020-08-24 17:53:02 +07:00
parent 9a1dbf5d94
commit 02d4889138
3 changed files with 81 additions and 21 deletions

66
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Deploy documentation
on:
push:
branches:
- master
paths-ignore:
- examples/**
- tests/**
- LICENSE
- README.md
- .*.yml
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9.0-beta.4 - 3.9.0
- name: Checkout palace
uses: actions/checkout@v2
- name: Checkout alure
uses: actions/checkout@v2
with:
repository: kcat/alure
path: alure
- name: Install dependencies
run: |
sudo apt install \
cmake libopenal-dev libvorbis-dev libopusfile-dev libsndfile1-dev
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -S alure -B alure/build
sudo cmake --build alure/build --parallel `nproc` --target install
rm -fr alure
python -m pip install Sphinx .
- name: Build site
working-directory: docs
run: make html
- name: Configure git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
git fetch origin gh-pages
- name: Deploy site
run: |
git switch gh-pages
git rm -r .
shopt -s dotglob
mv docs/build/html/* .
rm -r docs
git add .
git commit -m "Build at $(date --iso-8601=seconds)"
git push origin gh-pages

View File

@ -1,20 +1,18 @@
name: lint
name: Quick check
on:
push:
branches:
- master
- master
pull_request:
branches:
- master
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
@ -23,5 +21,8 @@ jobs:
- name: Install tox
run: python -m pip install tox
- name: Checkout
uses: actions/checkout@v2
- name: Main check
run: python -m tox -e lint

View File

@ -48,21 +48,19 @@ Submitting a Patch
------------------
We accept all kinds of patches, from documentation and CI/CD setup
to bug fixes, feature implementations and tests. Except for documentation
located in the ``gh-pages`` branch, others should be filed against
the development branch ``master``. These are hosted on GitHub and
one may create a local repository by running::
to bug fixes, feature implementations and tests. These are hosted on GitHub
and one may create a local repository by running::
git clone https://github.com/McSinyx/palace
While the patch can be submitted via email, it is preferable to file
a pull request on GitHub to allow more people to review it, since we do not
have any mail list. Either way, contributors must have legal permission
to distribute the code and it must be available under `LGPLv3+`_. Furthermore,
each contributor retains the copyrights of their patch, to ensure that
the licence can never be revoked even if others wants to. It is advisable
that the author list per legal name under the copyright header
of each source file they modify, like so::
a pull request on GitHub against the ``master`` branch to allow more people
to review it, since we do not have any mail list. Either way, contributors
must have legal permission to distribute the code and it must be available
under `LGPLv3+`_. Furthermore, each contributor retains the copyrights
of their patch, to ensure that the licence can never be revoked even if
others wants to. It is advisable that the author list per legal name
under the copyright header of each source file they modify, like so::
Copyright (C) 2038 Foo Bar
@ -128,11 +126,6 @@ to improve the CI/CD may find it helpful.
to build the wheels and publish them to PyPI.
#. Wait for the wheel for your platform to arrive to PyPI and install it.
Play around with it for a little to make sure that everything is OK.
#. Under the local repository, checkout the ``gh-pages`` branch.
Often, is it necessary to update the credits under the :doc:`copying`
section and review if the :doc:`reference/index` section needs any change
before running ``make html`` to rebuild to documentation.
#. View the documentation locally then push it to GitHub.
Style Guidelines
----------------