Release/3.1.0 (#22) #21
Workflow file for this 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
name: Generate Docs | |
# trigger with tag | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: oracle | |
java-version: 17 | |
cache: gradle | |
- name: Run line to check for starting directory path | |
run: pwd && ls | |
- name: Setup git config | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Setup project secrets | |
env: | |
GPR_USER: ${{ secrets.GPR_USER }} | |
GPR_API_KEY: ${{ secrets.GPR_API_KEY }} | |
if: env.GPR_USER == 'rjsuzuki' | |
run: | | |
echo "You sir, are qualified." | |
touch secrets.properties | |
echo gpr.usr=$GPR_USER > secrets.properties | |
echo gpr.key=$GPR_API_KEY >> secrets.properties | |
- name: Update branch | |
shell: bash | |
run: git pull origin docs -f | |
- name: Generate documentation | |
shell: bash | |
run: | | |
./gradlew dokkaHtmlMultiModule | |
cp -r ./lib/build/dokka/htmlMultiModule/ ./docs | |
- name: Commit files | |
id: commit | |
shell: bash | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "github-actions" | |
git add --all | |
if [-z "$(git status --porcelain)"]; then | |
echo "::set-output name=push::false" | |
else | |
git commit -m "Add changelog" -a | |
echo "::set-output name=push::true" | |
fi | |
- name: Push files | |
if: steps.commit.outputs.push == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: docs |