diff options
| author | Joel Challis <git@zvecr.com> | 2024-06-13 02:59:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 02:59:37 +0100 |
| commit | fa403562500e1229256ea355d36a8bf4c7967021 (patch) | |
| tree | 9a640384bab6c53de83eef4859f921efb08bfe0e /.github/workflows/docs.yml | |
| parent | 7247039742fb81cbf1e443c23a8070afb5961762 (diff) | |
Ensure documentation pull requests build (#23908)
Diffstat (limited to '.github/workflows/docs.yml')
| -rw-r--r-- | .github/workflows/docs.yml | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 25311019c6..0fdd2c7b37 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml | |||
| @@ -7,7 +7,6 @@ on: | |||
| 7 | push: | 7 | push: |
| 8 | branches: | 8 | branches: |
| 9 | - master | 9 | - master |
| 10 | - vitepress | ||
| 11 | paths: | 10 | paths: |
| 12 | - 'builddefs/docsgen/**' | 11 | - 'builddefs/docsgen/**' |
| 13 | - 'tmk_core/**' | 12 | - 'tmk_core/**' |
| @@ -15,6 +14,11 @@ on: | |||
| 15 | - 'platforms/**' | 14 | - 'platforms/**' |
| 16 | - 'docs/**' | 15 | - 'docs/**' |
| 17 | - '.github/workflows/docs.yml' | 16 | - '.github/workflows/docs.yml' |
| 17 | pull_request: | ||
| 18 | paths: | ||
| 19 | - 'builddefs/docsgen/**' | ||
| 20 | - 'docs/**' | ||
| 21 | - '.github/workflows/docs.yml' | ||
| 18 | 22 | ||
| 19 | defaults: | 23 | defaults: |
| 20 | run: | 24 | run: |
| @@ -25,9 +29,6 @@ jobs: | |||
| 25 | runs-on: ubuntu-latest | 29 | runs-on: ubuntu-latest |
| 26 | container: ghcr.io/qmk/qmk_cli | 30 | container: ghcr.io/qmk/qmk_cli |
| 27 | 31 | ||
| 28 | # protect against those who develop with their fork on master | ||
| 29 | if: github.repository == 'qmk/qmk_firmware' || (github.repository == 'tzarc/qmk_firmware' && github.ref == 'refs/heads/vitepress') | ||
| 30 | |||
| 31 | steps: | 32 | steps: |
| 32 | - uses: actions/checkout@v4 | 33 | - uses: actions/checkout@v4 |
| 33 | with: | 34 | with: |
| @@ -35,10 +36,10 @@ jobs: | |||
| 35 | 36 | ||
| 36 | - name: Install dependencies | 37 | - name: Install dependencies |
| 37 | run: | | 38 | run: | |
| 38 | apt-get update && apt-get install -y rsync doxygen curl | 39 | apt-get update && apt-get install -y rsync doxygen |
| 39 | # install nvm | 40 | # install nvm |
| 40 | touch $HOME/.bashrc | 41 | touch $HOME/.bashrc |
| 41 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | 42 | wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash |
| 42 | 43 | ||
| 43 | - name: Install node | 44 | - name: Install node |
| 44 | run: | | 45 | run: | |
| @@ -46,29 +47,15 @@ jobs: | |||
| 46 | nvm install 20 | 47 | nvm install 20 |
| 47 | nvm use 20 | 48 | nvm use 20 |
| 48 | corepack enable | 49 | corepack enable |
| 49 | npm install -g moxygen | ||
| 50 | 50 | ||
| 51 | - name: Build docs | 51 | - name: Build docs |
| 52 | run: | | 52 | run: | |
| 53 | source $HOME/.bashrc | 53 | source $HOME/.bashrc |
| 54 | nvm use 20 | 54 | nvm use 20 |
| 55 | qmk --verbose generate-docs | 55 | qmk --verbose generate-docs |
| 56 | touch '.build/docs/.nojekyll' | ||
| 57 | |||
| 58 | - name: Set CNAME | ||
| 59 | if: github.repository == 'qmk/qmk_firmware' | ||
| 60 | run: | | ||
| 61 | # Override target CNAME | ||
| 62 | echo 'docs.qmk.fm' > .build/docs/CNAME | ||
| 63 | |||
| 64 | - name: Override CNAME | ||
| 65 | if: github.repository == 'tzarc/qmk_firmware' | ||
| 66 | run: | | ||
| 67 | # Temporarily override target CNAME during development | ||
| 68 | echo 'vitepress.qmk.fm' > .build/docs/CNAME | ||
| 69 | 56 | ||
| 70 | - name: Deploy | 57 | - name: Deploy |
| 71 | if: github.repository == 'qmk/qmk_firmware' | 58 | if: ${{ github.event_name == 'push' && github.repository == 'qmk/qmk_firmware' }} |
| 72 | uses: JamesIves/github-pages-deploy-action@v4.6.1 | 59 | uses: JamesIves/github-pages-deploy-action@v4.6.1 |
| 73 | with: | 60 | with: |
| 74 | token: ${{ secrets.GITHUB_TOKEN }} | 61 | token: ${{ secrets.GITHUB_TOKEN }} |
| @@ -76,10 +63,3 @@ jobs: | |||
| 76 | folder: .build/docs | 63 | folder: .build/docs |
| 77 | git-config-name: QMK Bot | 64 | git-config-name: QMK Bot |
| 78 | git-config-email: hello@qmk.fm | 65 | git-config-email: hello@qmk.fm |
| 79 | |||
| 80 | - name: Deploy | ||
| 81 | if: github.repository == 'tzarc/qmk_firmware' | ||
| 82 | uses: JamesIves/github-pages-deploy-action@v4.6.1 | ||
| 83 | with: | ||
| 84 | branch: gh-pages | ||
| 85 | folder: .build/docs | ||
