mirror of
https://github.com/kmod-project/kmod.git
synced 2026-01-30 11:25:19 +00:00
- Do not use gerund for commit message - s/document/docs/ - Add commit sha to the doc commit message - Update token name - Add ci-test-docs branch to easily test changes Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Setup Ubuntu
|
|
uses: ./.github/actions/setup-ubuntu
|
|
|
|
- name: Build docs
|
|
run: |
|
|
meson setup -Ddocs=true build .
|
|
meson compile -C build
|
|
|
|
- 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: 'build/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@v3
|
|
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 }}"}'
|