-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ab5108
commit d476798
Showing
1 changed file
with
30 additions
and
48 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 |
---|---|---|
@@ -1,61 +1,43 @@ | ||
name: docs_pages_workflow | ||
# execute this workflow automatically when a we push to master | ||
name: Build-sphinx-docs | ||
|
||
# Controls when the workflow will run | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build_docs_job: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.4 | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2.2.1 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -U sphinx | ||
python -m pip install sphinx-rtd-theme | ||
# python -m pip install sphinxcontrib-apidoc | ||
python -m pip install sphinx-autoapi | ||
python -m pip install myst_parser | ||
python -m pip install furo | ||
- name: make the sphinx docs | ||
run: | | ||
make -C docs clean | ||
# sphinx-apidoc -f -o docs/source . -H Test -e -t docs/source/_templates | ||
make -C docs html | ||
- name: Init new repo in dist folder and commit generated files | ||
run: | | ||
cd docs/build/html/ | ||
git init | ||
git branch -m master main | ||
touch .nojekyll | ||
git add -A | ||
git config --local init.defaultBranch master | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config --system --add safe.directory /github/workspace/docs/build/html | ||
git commit -m 'deploy' | ||
- name: Force push to destination branch | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: kennylajara/wml-docs | ||
branch: served | ||
force: true | ||
directory: ./docs/build/html | ||
- name: Build HTML | ||
run: | | ||
cd docs/ | ||
make html | ||
- name: Run ghp-import | ||
run: | | ||
ghp-import -n -p -f docs/build/html |