Skip to content

Workflow file for this run

name: Generate release docs and commit to documentation branch (which is published to github pages)
on:
release:
types: [released]
push:
branches:
- ecm/doc-bot
jobs:
dokka:
runs-on: ubuntu-22.04
env:
CI_COMMIT_MESSAGE: Generated docs for ${{ github.sha }}
GH_TOKEN: ${{ github.token }}
steps:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Checkout code
uses: actions/checkout@v4
with:
ref: documentation
fetch-depth: 0
- name: Git config
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch origin
- name: Update documentation branch from master
run: |
git checkout -b "documentation-${{ github.sha }}"
git merge origin/master -m "Merge changes from master for ${{ github.sha }}" --no-edit
- name: Generate Dokka documentation
run: ./gradlew dokkaHtmlMultiModule
- name: Commit and push documentation
run: |
git add .
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push -u origin "documentation-${{ github.sha }}"
- name: Create PR for doc updates
run: |
gh pr create --draft --title "Generated Docs for \"$(git show -s --format=%B ${{ github.sha }})\"" --body "This PR was automatically generated by a GitHub Action for ${{ github.sha }}." -B "documentation" -H "documentation-${{ github.sha }}"