License check #1242
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: Documentation | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: [ main ] | |
jobs: | |
generate_and_push_doc_for_openapi: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Fetch all tags since Gradle project version is built upon SCM | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Generate Markdown documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-disabled: false | |
# Cache storage space is limited for GitHub actions | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
arguments: openApiMarkdownGenerate | |
- name: Generate UML documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-disabled: false | |
# Cache storage space is limited for GitHub actions | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
arguments: openApiUmlGenerate | |
- name: Set Git identity | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
run: | | |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git config --global user.name "$GITHUB_ACTOR" | |
- name: Push generated documentation if needed | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
run: | | |
git fetch --prune | |
git pull --rebase --autostash | |
if [[ `git status --porcelain` ]]; then | |
git checkout -b api_documentation | |
git add doc/ openapi/plantuml/ | |
git commit -m "chore(docs): Update generated documentation" \ | |
-m "Co-authored-by: csmplatform <csmplatform@users.noreply.github.com>" | |
git push --set-upstream origin api_documentation | |
gh pr create -B main -H api_documentation --title 'Merge api_documentation into main' --body 'Created by Github action' | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
generate_and_push_doc_for_helm_charts: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update Helm Charts documentation | |
run: ./scripts/kubernetes/update-helm-chart-readme.sh | |
- name: Set Git identity | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
run: | | |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git config --global user.name "$GITHUB_ACTOR" | |
- name: Push generated documentation if needed | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
run: | | |
git fetch --prune | |
git pull --rebase --autostash | |
if [[ `git status --porcelain` ]]; then | |
git checkout -b helm_documentation | |
git add api/kubernetes/*/README.md | |
git commit -m "chore(docs): Update generated Helm Charts documentations" \ | |
-m "Co-authored-by: csmplatform <csmplatform@users.noreply.github.com>" | |
git push --set-upstream origin helm_documentation | |
gh pr create -B main -H helm_documentation --title 'Merge helm_documentation into main' --body 'Created by Github action' | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |