-
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.
- Loading branch information
1 parent
3e1796f
commit bacdf42
Showing
1 changed file
with
33 additions
and
19 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 |
---|---|---|
|
@@ -2,9 +2,8 @@ name: Build and Deploy API Documentation | |
|
||
on: | ||
push: | ||
tags: | ||
# Match 1.0.0 but not 1.0.0-rc1 or other suffixes | ||
- '[1-9]+.[0-9]+.[0-9]+' | ||
branches: | ||
- adam/github_actions_test | ||
|
||
jobs: | ||
generate_docs: | ||
|
@@ -14,32 +13,47 @@ jobs: | |
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout the branch with the latest code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
# ref: ${{ github.ref_name }} | ||
ref: 'adam/github_actions_test' | ||
path: 'code' | ||
- name: Checkout the branch with the docs | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'docs' | ||
path: 'docs' | ||
- name: Print the current directory | ||
run: ls | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Copy docs to docs/dokka directory | ||
- name: Copy docs to the code directory | ||
run: | | ||
git fetch origin docs:docs | ||
git checkout docs | ||
mkdir -p docs/dokka || true | ||
cp -R current/ docs/dokka/current | ||
cp -R history/ docs/dokka/history | ||
git checkout ${{ github.ref_name }} | ||
cp -R ./docs/current/ ./code/docs/dokka/current | ||
cp -R ./docs/history/ ./code/docs/dokka/history | ||
- name: Generate Dokka Documentation | ||
run: ./gradlew dokkaHtmlMultiModule | ||
- name: Update Docs Branch | ||
working-directory: ./code | ||
run: | | ||
git tag -a 2.2.0 -m "Test" | ||
./gradlew dokkaHtmlMultiModule | ||
- name: Update Docs | ||
run: | | ||
cp -R code/docs/dokka/history docs/ | ||
cp -R code/docs/dokka/current current/ | ||
- name: Push updated docs | ||
working-directory: ./docs | ||
run: | | ||
git checkout docs | ||
cp -R docs/dokka/history . | ||
cp -R docs/dokka/current . | ||
git add history | ||
git add current | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git commit -m "Update API documentation for ${{ github.ref_name }}" | ||
git push origin docs | ||
# git commit -m "Update API documentation for ${{ github.ref_name }}" | ||
git commit -m "Update API documentation for VERSION_HERE" | ||
#git push origin docs | ||
- name: Print the docs directory | ||
working-directory: ./docs/history | ||
run: ls |