2020-11-10 16:00:40 +01:00
|
|
|
name: Generate Docs
|
|
|
|
|
2022-12-23 00:41:16 +01:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2020-11-10 16:00:40 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-05-30 04:00:41 +02:00
|
|
|
- vitepress
|
2020-11-10 16:00:40 +01:00
|
|
|
paths:
|
2024-05-30 04:00:41 +02:00
|
|
|
- 'builddefs/docsgen/**'
|
2020-11-10 16:00:40 +01:00
|
|
|
- 'tmk_core/**'
|
|
|
|
- 'quantum/**'
|
|
|
|
- 'platforms/**'
|
|
|
|
- 'docs/**'
|
|
|
|
- '.github/workflows/docs.yml'
|
|
|
|
|
2024-05-30 04:00:41 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2020-11-10 16:00:40 +01:00
|
|
|
jobs:
|
|
|
|
generate:
|
|
|
|
runs-on: ubuntu-latest
|
2023-03-17 02:32:09 +01:00
|
|
|
container: ghcr.io/qmk/qmk_cli
|
2020-11-10 16:00:40 +01:00
|
|
|
|
|
|
|
# protect against those who develop with their fork on master
|
2024-05-30 04:00:41 +02:00
|
|
|
if: github.repository == 'qmk/qmk_firmware' || (github.repository == 'tzarc/qmk_firmware' && github.ref == 'refs/heads/vitepress')
|
2020-11-10 16:00:40 +01:00
|
|
|
|
|
|
|
steps:
|
2023-09-05 19:50:04 +02:00
|
|
|
- uses: actions/checkout@v4
|
2020-11-10 16:00:40 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-05-30 04:00:41 +02:00
|
|
|
apt-get update && apt-get install -y rsync doxygen curl
|
|
|
|
# install nvm
|
|
|
|
touch $HOME/.bashrc
|
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
|
|
|
|
|
|
- name: Install node
|
|
|
|
run: |
|
|
|
|
source $HOME/.bashrc
|
|
|
|
nvm install 20
|
|
|
|
nvm use 20
|
|
|
|
corepack enable
|
2020-11-10 16:00:40 +01:00
|
|
|
npm install -g moxygen
|
|
|
|
|
|
|
|
- name: Build docs
|
|
|
|
run: |
|
2024-05-30 04:00:41 +02:00
|
|
|
source $HOME/.bashrc
|
|
|
|
nvm use 20
|
2020-11-10 16:00:40 +01:00
|
|
|
qmk --verbose generate-docs
|
2024-05-30 04:00:41 +02:00
|
|
|
touch '.build/docs/.nojekyll'
|
|
|
|
|
|
|
|
- name: Set CNAME
|
|
|
|
if: github.repository == 'qmk/qmk_firmware'
|
|
|
|
run: |
|
|
|
|
# Override target CNAME
|
|
|
|
echo 'docs.qmk.fm' > .build/docs/CNAME
|
|
|
|
|
|
|
|
- name: Override CNAME
|
|
|
|
if: github.repository == 'tzarc/qmk_firmware'
|
|
|
|
run: |
|
|
|
|
# Temporarily override target CNAME during development
|
|
|
|
echo 'vitepress.qmk.fm' > .build/docs/CNAME
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
if: github.repository == 'qmk/qmk_firmware'
|
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.6.1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: gh-pages
|
|
|
|
folder: .build/docs
|
|
|
|
git-config-name: QMK Bot
|
|
|
|
git-config-email: hello@qmk.fm
|
2020-11-10 16:00:40 +01:00
|
|
|
|
|
|
|
- name: Deploy
|
2024-05-30 04:00:41 +02:00
|
|
|
if: github.repository == 'tzarc/qmk_firmware'
|
2024-05-20 22:01:20 +02:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.6.1
|
2020-11-10 16:00:40 +01:00
|
|
|
with:
|
2024-05-30 04:00:41 +02:00
|
|
|
branch: gh-pages
|
|
|
|
folder: .build/docs
|