Skip to content

Publish Site

Publish Site #8

name: Publish Site
on:
workflow_dispatch:
inputs:
checkout-ref:
description: "The branch, tag or SHA to checkout. See actions/checkout 'ref'."
required: false
type: string
workflow_call:
inputs:
checkout-ref:
description: "The branch, tag or SHA to checkout. See actions/checkout 'ref'."
required: false
type: string
concurrency:
group: "Publish Site: ${{ github.workflow }}"
cancel-in-progress: true
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref || github.ref }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Build site
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
# write build cache on 'main' and 'release' branches, or tags (default is 'main' only)
cache-read-only: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release') && !startsWith(github.ref, 'refs/tags/') }}
arguments: |
:modules:docs:docusaurusBuild
- name: Upload Dokka to Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./modules/docs/site/build/
deploy:
needs:
- build-site
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4