Skip to content

Publish Dokka Docs

Publish Dokka Docs #14

Workflow file for this run

name: Publish Dokka Docs
on:
push:
branches:
- ${{ github.event.repository.default_branch }}

Check failure on line 6 in .github/workflows/publish-docs.yml

View workflow run for this annotation

GitHub Actions / Publish Dokka Docs

Invalid workflow file

The workflow is not valid. .github/workflows/publish-docs.yml (Line: 6, Col: 9): Unrecognized named-value: 'github'. Located at position 1 within expression: github.event.repository.default_branch
workflow_dispatch:
permissions:
contents: read
id-token: write
pages: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact: ${{ steps.define-ids.outputs.artifact }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define instance id and artifacts
id: define-ids
run: |
ARTIFACT="dokka-docs.zip"
# Print the values
echo "artifact=$ARTIFACT"
# Set the output
echo "::set-output name=artifact::$ARTIFACT"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build docs using Dokka
run: ./gradlew dokkaGenerate
- name: Zip docs
run: |
mkdir -p artifacts
cd build/dokka/html
zip -r ../../../artifacts/${{ steps.define-ids.outputs.artifact }} .
- name: Verify zip file
run: ls -la artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: artifacts/${{ needs.build.outputs.artifact }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download docs
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts
- name: Unzip artifact
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4