forked from qmk/qmk_firmware
-
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.
CI: Add docs build and deploy workflow (qmk#7448)
* Add docs build and deploy workflow * Remove old travis docs workflow * update to cli command * Tidy up for review * formatting * Update to pass style checks * Update lib/python/qmk/cli/docs.py Co-Authored-By: skullydazed <[email protected]> * Review comments - build->generate, use of verbose * Add docs * Update to match recent actions * Run within base_container * Convert cli to generate-docs * Convert cli to generate-docs - restore old file * Convert cli to generate-docs * Update docs Co-authored-by: skullydazed <[email protected]>
- Loading branch information
1 parent
abf1902
commit aae3b35
Showing
6 changed files
with
91 additions
and
20 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,43 @@ | ||
name: Generate Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'tmk_core/**' | ||
- 'quantum/**' | ||
- 'platforms/**' | ||
- 'docs/**' | ||
- '.github/workflows/docs.yml' | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
container: qmkfm/base_container | ||
|
||
# protect against those who develop with their fork on master | ||
if: github.repository == 'qmk/qmk_firmware' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt-get update && apt-get install -y rsync nodejs npm doxygen | ||
npm install -g moxygen | ||
- name: Build docs | ||
run: | | ||
qmk --verbose generate-docs | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BASE_BRANCH: master | ||
BRANCH: gh-pages | ||
FOLDER: .build/docs | ||
GIT_CONFIG_EMAIL: [email protected] |
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
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
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 +1,2 @@ | ||
from . import api | ||
from . import docs |
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,37 @@ | ||
"""Build QMK documentation locally | ||
""" | ||
import shutil | ||
import subprocess | ||
from pathlib import Path | ||
|
||
from milc import cli | ||
|
||
DOCS_PATH = Path('docs/') | ||
BUILD_PATH = Path('.build/docs/') | ||
|
||
|
||
@cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True) | ||
def generate_docs(cli): | ||
"""Invoke the docs generation process | ||
TODO(unclaimed): | ||
* [ ] Add a real build step... something static docs | ||
""" | ||
|
||
if BUILD_PATH.exists(): | ||
shutil.rmtree(BUILD_PATH) | ||
|
||
shutil.copytree(DOCS_PATH, BUILD_PATH) | ||
|
||
# When not verbose we want to hide all output | ||
args = {'check': True} | ||
if not cli.args.verbose: | ||
args.update({'stdout': subprocess.DEVNULL, 'stderr': subprocess.STDOUT}) | ||
|
||
cli.log.info('Generating internal docs...') | ||
|
||
# Generate internal docs | ||
subprocess.run(['doxygen', 'Doxyfile'], **args) | ||
subprocess.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args) | ||
|
||
cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH) |
This file was deleted.
Oops, something went wrong.