| 1 |
name: Update API Documentation |
| 2 |
on: |
| 3 |
workflow_dispatch: |
| 4 |
release: |
| 5 |
types: |
| 6 |
- published |
| 7 |
|
| 8 |
permissions: {} |
| 9 |
|
| 10 |
jobs: |
| 11 |
build-docs: |
| 12 |
name: Build API Documentation |
| 13 |
runs-on: ubuntu-latest |
| 14 |
steps: |
| 15 |
- name: Checkout |
| 16 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6 |
| 17 |
with: |
| 18 |
persist-credentials: false |
| 19 |
|
| 20 |
- name: Install doxygen |
| 21 |
run: sudo apt-get install doxygen |
| 22 |
|
| 23 |
- name: Build doxygen |
| 24 |
run: | |
| 25 |
cmake -S. -Bbuild |
| 26 |
cmake --build build --target docs |
| 27 |
|
| 28 |
- name: Upload Artifact |
| 29 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # was: actions/upload-artifact@v7 |
| 30 |
with: |
| 31 |
name: api-docs |
| 32 |
path: build/doxygen/html |
| 33 |
|
| 34 |
commit-docs: |
| 35 |
name: Update cmusphinx.github.io |
| 36 |
needs: build-docs |
| 37 |
runs-on: ubuntu-latest |
| 38 |
permissions: |
| 39 |
contents: write |
| 40 |
steps: |
| 41 |
- name: Checkout |
| 42 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6 |
| 43 |
with: |
| 44 |
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }} |
| 45 |
repository: cmusphinx/cmusphinx.github.io |
| 46 |
|
| 47 |
- name: Remove Previous Docs |
| 48 |
run: rm -rf doc/pocketsphinx |
| 49 |
|
| 50 |
- name: Download Artifact |
| 51 |
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 52 |
with: |
| 53 |
name: api-docs |
| 54 |
path: doc/pocketsphinx |
| 55 |
|
| 56 |
- name: Commit upstream |
| 57 |
run: | |
| 58 |
git config user.name "github-actions[bot]" |
| 59 |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 60 |
git add doc/pocketsphinx |
| 61 |
if git commit -m 'chore: update PocketSphinx API documentation'; then |
| 62 |
git push |
| 63 |
fi |