Skip to content

Publish Site

Publish Site #4

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-dokka:
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: dokkatooGenerate
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:dokkatooGenerate
- name: Upload Dokka to Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./modules/docs/build/dokka/html/
build-writerside:
runs-on: ubuntu-latest
env:
WRITERSIDE_INSTANCE: "modules/docs/d"
WRITERSIDE_DOC_ZIP: "webHelpD2-all.zip"
steps:
- name: Build Writerside docs
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.WRITERSIDE_INSTANCE }}
artifact: ${{ env.WRITERSIDE_DOC_ZIP }}
docker-version: "233.14389"
- name: Writerside check
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.WRITERSIDE_INSTANCE }}
- name: Unpack Writerside zip
run: unzip -O UTF-8 -qq '${{ env.WS_ALL_ZIP }}' -d writerside-dir
- name: Upload Writerside to Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./writerside-dir/
deploy:
needs:
- build-dokka
- build-writerside
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