Deploy Reference Documentation #85
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: Deploy Reference Documentation | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'SDK Version' | |
required: true | |
type: string | |
permissions: | |
id-token: write | |
jobs: | |
deploy-reference-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '21' | |
- name: Pull Previous Versions Docs | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "eg-oss-ci" | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
git fetch --all | |
BRANCH_EXISTS=$(git ls-remote --heads origin mdwairi/add-version-json-files | wc -l) | |
if [ "$BRANCH_EXISTS" -eq 0 ]; then | |
git checkout --orphan mdwairi/add-version-json-files | |
else | |
git checkout mdwairi/add-version-json-files | |
git pull origin mdwairi/add-version-json-files | |
fi | |
mkdir previous-versions | |
find . -type d -maxdepth 1 ! -path ./previous-versions ! -path . -exec mv {} ./previous-versions \; | |
git checkout $CURRENT_BRANCH -- previous-versions | |
- name: Generate new docs | |
run: | | |
mvn -f code dokka:dokka -Ddokka-previous-versions.location=previous-versions | |
- name: Test | |
run: | | |
cd ./code/target/dokka | |
ls | |
# - name: Commit | |
# run: | | |
# git add . | |
# git commit -m "chore: publishing docs for version ${{ github.event.inputs.version }}" | |
# | |
# - name: Create Pull Request | |
# uses: peter-evans/create-pull-request@v6 | |
# with: | |
# token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
# commit-message: "chore: publishing docs for version ${{ github.event.inputs.version }}" | |
# body: "This PR adds the reference documentation for version ${{ github.event.inputs.version }}." | |
# title: "chore: reference docs update for version ${{ github.event.inputs.version }}" | |
# branch: "docs-update-${{ github.event.inputs.version }}" |