Skip to content

Commit

Permalink
Workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc committed May 25, 2024
1 parent 4954a3a commit d97ef96
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ on:
push:
branches:
- master
- vitepress
paths:
- 'tmk_core/**'
- 'quantum/**'
- 'platforms/**'
- 'docs/**'
- '.github/workflows/docs.yml'

defaults:
run:
shell: bash

jobs:
generate:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli

# protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware'
if: github.repository == 'qmk/qmk_firmware' || (github.repository == 'tzarc/qmk_firmware' && github.ref == 'refs/heads/vitepress')

steps:
- uses: actions/checkout@v4
Expand All @@ -29,18 +34,42 @@ jobs:

- name: Install dependencies
run: |
apt-get update && apt-get install -y rsync nodejs npm doxygen
apt-get update && apt-get install -y rsync doxygen curl
curl -fsSL https://fnm.vercel.app/install | bash # installs fnm (Fast Node Manager)
- name: Install node
run: |
source $HOME/.bashrc
fnm use --install-if-missing 20 # download and install Node.js
corepack enable
npm install -g moxygen
- name: Build docs
run: |
source $HOME/.bashrc
fnm use --install-if-missing 20 # download and install Node.js
qmk --verbose generate-docs
touch '.build/docs/.nojekyll'
- name: Override CNAME
if: github.repository == 'tzarc/qmk_firmware'
run: |
# Temporarily override target CNAME
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

- name: Deploy
if: github.repository == 'tzarc/qmk_firmware'
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: .build/docs
GIT_CONFIG_EMAIL: hello@qmk.fm
branch: gh-pages
folder: .build/docs

0 comments on commit d97ef96

Please sign in to comment.