-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from teogor/docs/deployment
Introduce MkDocs for documentation generation
- Loading branch information
Showing
20 changed files
with
767 additions
and
566 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,35 +28,51 @@ env: | |
jobs: | ||
synchronize-documentation: | ||
runs-on: ubuntu-latest | ||
name: Synchronize Repository API Documentation | ||
name: Synchronize Repository Documentation | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Grants execute permission to gradle (safety step) | ||
- name: Grant Permissions to gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mkdocs-material | ||
pip install mkdocs-material[recommended,git,imaging] | ||
- name: Build MkDocs | ||
run: | | ||
mkdocs build --clean | ||
mkdocs --version | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Generate API Documentation | ||
run: ./gradlew dokkaHtmlMultiModule | ||
run: ./gradlew -D'org.gradle.unsafe.configuration-cache=false' dokkaHtmlMultiModule | ||
|
||
- name: Relocate API Documentation Assets | ||
- name: Relocate API References | ||
run: | | ||
mkdir -p docs/${{ env.REPOSITORY }}/documentation | ||
cp -r build/dokka/htmlMultiModule/* docs/${{ env.REPOSITORY }}/documentation | ||
mkdir -p build/docs/${{ env.REPOSITORY }}/reference | ||
cp -r build/dokka/htmlMultiModule/* build/docs/${{ env.REPOSITORY }}/reference | ||
- id: publish-docs | ||
name: Deploy API Documentation | ||
name: Deploy Documentation | ||
uses: ./.github/workflows/sync-docs/ | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
with: | ||
source-file: docs/${{ env.REPOSITORY }}/documentation/ | ||
source-file: build/docs/${{ env.REPOSITORY }}/ | ||
destination-folder: ${{ env.REPOSITORY }} | ||
destination-repo: teogor/source.teogor.dev | ||
user-email: [email protected] | ||
|
@@ -73,6 +89,17 @@ jobs: | |
with: | ||
repository: teogor/source.teogor.dev | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
ref: ${{ env.DESTINATION_BRANCH || 'main' }} | ||
# This is important to fetch the changes to the previous commit | ||
fetch-depth: 0 | ||
|
||
# - name: Prettify code | ||
# uses: creyD/[email protected] | ||
# with: | ||
# # This part is also where you can pass other options, for example: | ||
# prettier_options: --write ${{ env.REPOSITORY }}/**/*.{js,html,css,json} | ||
# only_changed: False | ||
# same_commit: True | ||
|
||
- name: Create PR (Pull Request) | ||
run: | | ||
|
This file contains 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
Oops, something went wrong.