fa403562500e1229256ea355d36a8bf4c7967021

Author
Joel Challis <git@zvecr.com>
Committer
GitHub <noreply@github.com>
Date

Message

Ensure documentation pull requests build (#23908)

Diff

  1diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
  2index 25311019c6c9df126b0ead7f2925aebb4ca3ad9c..0fdd2c7b37d9c30e826c675b9d106471a28dd3b6 100644
  3--- a/.github/workflows/docs.yml
  4+++ b/.github/workflows/docs.yml
  5@@ -7,7 +7,6 @@ on:
  6   push:
  7     branches:
  8     - master
  9-    - vitepress
 10     paths:
 11     - 'builddefs/docsgen/**'
 12     - 'tmk_core/**'
 13@@ -15,6 +14,11 @@ on:
 14     - 'platforms/**'
 15     - 'docs/**'
 16     - '.github/workflows/docs.yml'
 17+  pull_request:
 18+    paths:
 19+    - 'builddefs/docsgen/**'
 20+    - 'docs/**'
 21+    - '.github/workflows/docs.yml'
 22 
 23 defaults:
 24   run:
 25@@ -25,9 +29,6 @@ jobs:
 26     runs-on: ubuntu-latest
 27     container: ghcr.io/qmk/qmk_cli
 28 
 29-    # protect against those who develop with their fork on master
 30-    if: github.repository == 'qmk/qmk_firmware' || (github.repository == 'tzarc/qmk_firmware' && github.ref == 'refs/heads/vitepress')
 31-
 32     steps:
 33     - uses: actions/checkout@v4
 34       with:
 35@@ -35,10 +36,10 @@ jobs:
 36 
 37     - name: Install dependencies
 38       run: |
 39-        apt-get update && apt-get install -y rsync doxygen curl
 40+        apt-get update && apt-get install -y rsync doxygen
 41         # install nvm
 42         touch $HOME/.bashrc
 43-        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
 44+        wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
 45 
 46     - name: Install node
 47       run: |
 48@@ -46,29 +47,15 @@ jobs:
 49         nvm install 20
 50         nvm use 20
 51         corepack enable
 52-        npm install -g moxygen
 53 
 54     - name: Build docs
 55       run: |
 56         source $HOME/.bashrc
 57         nvm use 20
 58         qmk --verbose generate-docs
 59-        touch '.build/docs/.nojekyll'
 60-
 61-    - name: Set CNAME
 62-      if: github.repository == 'qmk/qmk_firmware'
 63-      run: |
 64-        # Override target CNAME
 65-        echo 'docs.qmk.fm' > .build/docs/CNAME
 66-
 67-    - name: Override CNAME
 68-      if: github.repository == 'tzarc/qmk_firmware'
 69-      run: |
 70-        # Temporarily override target CNAME during development
 71-        echo 'vitepress.qmk.fm' > .build/docs/CNAME
 72 
 73     - name: Deploy
 74-      if: github.repository == 'qmk/qmk_firmware'
 75+      if: ${{ github.event_name == 'push' && github.repository == 'qmk/qmk_firmware' }}
 76       uses: JamesIves/github-pages-deploy-action@v4.6.1
 77       with:
 78           token: ${{ secrets.GITHUB_TOKEN }}
 79@@ -76,10 +63,3 @@ jobs:
 80           folder: .build/docs
 81           git-config-name: QMK Bot
 82           git-config-email: hello@qmk.fm
 83-
 84-    - name: Deploy
 85-      if: github.repository == 'tzarc/qmk_firmware'
 86-      uses: JamesIves/github-pages-deploy-action@v4.6.1
 87-      with:
 88-        branch: gh-pages
 89-        folder: .build/docs
 90diff --git a/docs/public/.nojekyll b/docs/public/.nojekyll
 91new file mode 100644
 92index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
 93--- /dev/null
 94+++ b/docs/public/.nojekyll
 95diff --git a/docs/public/CNAME b/docs/public/CNAME
 96new file mode 100644
 97index 0000000000000000000000000000000000000000..06276c90c406059482604afb71950d2e7da961a1
 98--- /dev/null
 99+++ b/docs/public/CNAME
100@@ -0,0 +1 @@
101+docs.qmk.fm