blob: a465dfdfc2ce6b2f023169e01a27bc8a420375b1 [file] [log] [blame]
name: Trigger kmod-project.github.io
on:
# Runs on pushes targeting master and tag with prefix `v`
push:
branches:
- 'master'
- 'ci-test-docs'
tags:
- 'v*'
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
docs:
runs-on: ubuntu-latest
container:
image: 'ubuntu:24.04'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup OS
uses: ./.github/actions/setup-os
- name: Build docs
run: |
meson setup -Ddocs=true builddir/
meson compile -C builddir/
- name: Extract docs version
shell: bash
run: |
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then
echo DOC_VERSION=${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo DOC_VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
else
exit 1
fi
echo DOC_VERSION_COMMIT="${GITHUB_SHA}" >> $GITHUB_ENV
- name: Push docs to kmod-project.github.io
uses: QXIP/github-action-push-to-another-repository@a910af640bd64288db58f0e71a361aabac022f8b
env:
API_TOKEN_GITHUB: ${{ secrets.KMOD_DOCS }}
with:
source-directory: 'builddir/libkmod/docs/html'
destination-github-username: '${{ github.repository_owner }}'
destination-repository-name: 'kmod-project.github.io'
user-name: 'github-actions[bot]'
user-email: '41898282+github-actions[bot]@users.noreply.github.com'
target-branch: 'pages'
commit-message: 'Auto-add ${{ env.DOC_VERSION }} docs for commit ${{ env.DOC_VERSION_COMMIT }}'
target-directory: '${{ env.DOC_VERSION }}'
- name: Dispatch kmod-project.github.io
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.KMOD_DOCS }}
repository: ${{ github.repository_owner }}/kmod-project.github.io
event-type: publish-doc
client-payload: '{"source":"${{ github.repository }}","version":"${{ env.DOC_VERSION }}"}'