-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create GitHub Action for documentation generation
- Loading branch information
1 parent
e50f255
commit 013e7f7
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build and publish documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
# Setup Doxygen | ||
wget https://sourceforge.net/projects/doxygen/files/rel-1.9.5/doxygen-1.9.5.linux.bin.tar.gz | ||
tar -xvf doxygen-1.9.5.linux.bin.tar.gz | ||
cp doxygen-1.9.5/bin/doxygen /usr/local/bin | ||
# Setup m.css | ||
pip install jinja2 pygments docutils | ||
# git clone https://github.com/mosra/m.css | ||
# TODO: Checkout a specific version here. | ||
# FIXME: Migrate off of my fork once PR is accepted. | ||
git clone https://github.com/parker-research/m.css --branch fix-pathlike-and-test | ||
- name: Build and install with Pip | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Build docs | ||
run: | | ||
./m.css/documentation/python.py ./docs/conf.py | ||
du -a ./build/docs/ | ||
du -a ./build/stubs/ | ||
- name: Upload | ||
if: github.event_name != 'pull_request' | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.SSH_DEPLOY_HOST }} | ||
username: ${{ secrets.SSH_DEPLOY_USERNAME }} | ||
port: ${{ secrets.SSH_DEPLOY_PORT }} | ||
key: ${{ secrets.SSH_DEPLOY_KEY }} | ||
passphrase: ${{ secrets.SSH_DEPLOY_PASSPHRASE }} | ||
source: slang.tar.gz | ||
target: upload/ | ||
- name: Deploy | ||
if: github.event_name != 'pull_request' | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_DEPLOY_HOST }} | ||
username: ${{ secrets.SSH_DEPLOY_USERNAME }} | ||
port: ${{ secrets.SSH_DEPLOY_PORT }} | ||
key: ${{ secrets.SSH_DEPLOY_KEY }} | ||
passphrase: ${{ secrets.SSH_DEPLOY_PASSPHRASE }} | ||
script: slang-website/deploy_docs.sh |