| 1 | name: Deploy Docs to GitHub |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: [published] |
| 6 | |
| 7 | permissions: |
| 8 | contents: read |
| 9 | pages: write |
| 10 | id-token: write |
| 11 | |
| 12 | concurrency: |
| 13 | group: "pages" |
| 14 | cancel-in-progress: true |
| 15 | |
| 16 | jobs: |
| 17 | deploy: |
| 18 | environment: |
| 19 | name: github-pages |
| 20 | url: ${{ steps.deployment.outputs.page_url }} |
| 21 | |
| 22 | runs-on: ubuntu-22.04 |
| 23 | steps: |
| 24 | - name: 'Checkout' |
| 25 | uses: actions/checkout@v6 |
| 26 | with: |
| 27 | fetch-depth: 0 |
| 28 | - name: 'Get latest tag' |
| 29 | run: echo "GIT_LATEST_TAG=$(git tag | grep '^[0-9]\+\.[0-9]\+\?\.[0-9]\+\?$' | sort -V -r | head -n1)" >> $GITHUB_ENV |
| 30 | |
| 31 | - name: 'Variables' |
| 32 | run: | |
| 33 | echo $GITHUB_REF_NAME |
| 34 | echo $GIT_LATEST_TAG |
| 35 | |
| 36 | - name: 'Install prerequisites' |
| 37 | if: github.ref_name == env.GIT_LATEST_TAG |
| 38 | run: | |
| 39 | sudo apt-get update |
| 40 | sudo apt-get install -y \ |
| 41 | libdrm-dev \ |
| 42 | doxygen \ |
| 43 | meson \ |
| 44 | - name: 'Build the Docs' |
| 45 | if: github.ref_name == env.GIT_LATEST_TAG |
| 46 | run: meson setup _build -D enable_docs=true && meson compile -C _build |
| 47 | |
| 48 | - name: 'Upload the artifacts' |
| 49 | if: github.ref_name == env.GIT_LATEST_TAG |
| 50 | uses: actions/upload-pages-artifact@v4 |
| 51 | with: |
| 52 | path: "_build/doc/html-out" |
| 53 | |
| 54 | - name: 'Deploy to GitHub Pages' |
| 55 | if: github.ref_name == env.GIT_LATEST_TAG |
| 56 | id: deployment |
| 57 | uses: actions/deploy-pages@v4 |