update github workflow for docusaurus

This commit is contained in:
Jack Humbert 2023-04-18 19:50:04 -04:00
parent d2c755c3dd
commit 29f2e9f19a
4 changed files with 20 additions and 6 deletions

View File

@ -27,20 +27,33 @@ jobs:
with: with:
fetch-depth: 1 fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Install dependencies - name: Install dependencies
run: | run: |
apt-get update && apt-get install -y rsync nodejs npm doxygen apt-get update && apt-get install -y rsync nodejs npm doxygen
npm install -g moxygen npm install -g moxygen
- name: Build docs - name: Build doxygen docs
run: | run: |
qmk --verbose generate-docs qmk --verbose generate-docs
- name: Install yarn dependencies
working-directory: .build/docs
run: yarn install --frozen-lockfile
- name: Build Docusaurus
working-directory: .build/docs
run: yarn build
- name: Deploy - name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.4.1 uses: JamesIves/github-pages-deploy-action@v4.4.1
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master BASE_BRANCH: master
BRANCH: gh-pages BRANCH: gh-pages
FOLDER: .build/docs FOLDER: .build/docs/build
GIT_CONFIG_EMAIL: hello@qmk.fm GIT_CONFIG_EMAIL: hello@qmk.fm

View File

@ -1,11 +1,11 @@
{ {
"name": "test", "name": "qmk_firmware_docs",
"version": "0.0.0", "version": "0.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "test", "name": "qmk_firmware_docs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@docusaurus/core": "2.4.0", "@docusaurus/core": "2.4.0",

View File

@ -1,5 +1,5 @@
{ {
"name": "test", "name": "qmk_firmware_docs",
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -26,7 +26,8 @@ def generate_docs(cli):
if DOXYGEN_PATH.exists(): if DOXYGEN_PATH.exists():
shutil.rmtree(DOXYGEN_PATH) shutil.rmtree(DOXYGEN_PATH)
shutil.copytree(DOCS_PATH, BUILD_DOCS_PATH) # ignore node_modules when we're testing locally
shutil.copytree(DOCS_PATH, BUILD_DOCS_PATH, ignore=shutil.ignore_patterns("node_modules"))
# When not verbose we want to hide all output # When not verbose we want to hide all output
args = { args = {