-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create docs workflow to build API docs
- Loading branch information
1 parent
fe838b7
commit b2396ed
Showing
1 changed file
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build and Deploy API Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- adam/371_docs_workflow | ||
# tags: | ||
# - '[0-9]+\.[0-9]+\.[0-9]' | ||
# - '![0-9]+\.[0-9]+\.[0-9]-[a-z]*' | ||
# - '![0-9]+\.[0-9]+\.[0-9]-[A-Z]*' | ||
|
||
jobs: | ||
generate_docs: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Copy docs to docs/dokka directory | ||
run: | | ||
# git fetch origin docs:docs | ||
git fetch origin adam/only_docs:adam/only_docs | ||
# git checkout docs | ||
git checkout adam/only_docs | ||
mkdir -p docs/dokka || true | ||
cp -R current/ docs/dokka/current | ||
cp -R history/ docs/dokka/history | ||
# git checkout ${{ github.ref_name }} | ||
git checkout adam/371_docs_workflow | ||
- name: Generate Dokka Documentation | ||
run: ./gradlew dokkaHtmlMultiModule | ||
- name: Update Docs Branch | ||
run: | | ||
TAG=$(git describe --tags --abbrev=0) | ||
# git checkout docs | ||
git checkout adam/only_docs | ||
cp -R docs/dokka/history . | ||
cp -R docs/dokka/current . | ||
git add history | ||
git add current | ||
git fetch --tags | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
# git commit -m "Update API documentation for ${{ github.ref_name }}" | ||
git commit -m "Update API documentation for $TAG" | ||
# git push origin docs | ||
git push origin adam/only_docs |