Merge pull request #13 from SLNE-Development/feat/dokka #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Dokka Docs | |
| on: | |
| push: | |
| branches: | |
| - version/1.21 | |
| 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 environment variables and outputs | |
| echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Build docs using Dokka | |
| run: ./gradlew dokkaHtmlMultiModule | |
| - name: Upload docs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| path: | | |
| build/dokka/htmlMultiModule | |
| 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: build/dokka/htmlMultiModule | |
| - 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 |