Skip to content

Commit

Permalink
generate dokka HTML docs with GH & deploy to GH pages
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Jan 18, 2024
1 parent e189257 commit 5e1ba8a
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Generate & deploy docs to GitHub Pages

on:
pull_request:
branches: [ master ] # TODO change after experimenting
# To make it able to run manually
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
# Setting up pages and generating the docs
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Generate API documentation
# VERSION=$(git tag --sort=committerdate | tail -1)
run: |
VERSION= $(git log -1 --pretty=format:"%H") # Switch to the one above once we're sure it's working
echo Generating API documentation for version $VERSION
./gradlew -Pversion=$VERSION dokkaHtml
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build/dokka/html

deploy:
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 5e1ba8a

Please sign in to comment.