chore(docs-util): Improve generate references script and action (#5472)
* chore(docs-util): Improve generate references script and action * added if condition for API reference * fix api reference condition * fix description of action * fix body value * fix step name
This commit is contained in:
230
.github/workflows/generate-references.yml
vendored
230
.github/workflows/generate-references.yml
vendored
@@ -1,11 +1,16 @@
|
||||
name: Generate Documentation Reference
|
||||
name: Generate Automated Documentation
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
referenceName:
|
||||
description: 'Reference to Generate. Use either `all` to generate all references, `api` to generate the API reference, or a name of a config file in `docs-util/packages/typedoc-config` such as `product`'
|
||||
required: false
|
||||
default: 'all'
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
services:
|
||||
references:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
@@ -40,22 +45,35 @@ jobs:
|
||||
run: yarn build
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Generate Services Reference
|
||||
run: yarn generate:reference services
|
||||
- name: Generate References
|
||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
run: "yarn generate:reference ${{ github.event.inputs.referenceName }}"
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Generate References
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
run: "yarn generate:reference all"
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Get PR Message
|
||||
id: pr-message
|
||||
run: yarn generate:message
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "chore(docs): Generated Services Reference (automated)"
|
||||
commit-message: "chore(docs): Generated References (automated)"
|
||||
base: "develop"
|
||||
title: "chore(docs): Generated Services Reference (automated)"
|
||||
title: "chore(docs): Generated References"
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/docs/content/references/services/**
|
||||
branch: "docs/generate-services"
|
||||
add-paths: www/apps/docs/content/references/**
|
||||
branch: "docs/generate-reference"
|
||||
branch-suffix: "timestamp"
|
||||
body: ${{ steps.pr-message.outputs.body }}
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'release' || github.event.inputs.referenceName == 'all' || github.event.inputs.referenceName == 'api' }}
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
@@ -94,200 +112,4 @@ jobs:
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/api-reference/specs
|
||||
branch: "docs/generate-api-ref"
|
||||
branch-suffix: "timestamp"
|
||||
entities:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.20.2"
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/cache-deps
|
||||
with:
|
||||
extension: reference
|
||||
|
||||
- name: Build Packages
|
||||
run: yarn build
|
||||
|
||||
- name: Install Workspace dependencies
|
||||
run: yarn install
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Build Workspace dependencies
|
||||
run: yarn build
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Generate Entities Reference
|
||||
run: yarn generate:reference entities
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "chore(docs): Generated Entities Reference (automated)"
|
||||
base: "develop"
|
||||
title: "chore(docs): Generated Entities Reference (automated)"
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/docs/content/references/entities/**
|
||||
branch: "docs/generate-entities"
|
||||
branch-suffix: "timestamp"
|
||||
js-client:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.20.2"
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/cache-deps
|
||||
with:
|
||||
extension: reference
|
||||
|
||||
- name: Build Packages
|
||||
run: yarn build
|
||||
|
||||
- name: Install Workspace dependencies
|
||||
run: yarn install
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Build Workspace dependencies
|
||||
run: yarn build
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Generate Services Reference
|
||||
run: yarn generate:reference js-client
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "chore(docs): Generated JS Client Reference (automated)"
|
||||
base: "develop"
|
||||
title: "chore(docs): Generated JS Client Reference"
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/docs/content/references/js-client/**
|
||||
branch: "docs/generate-js-client"
|
||||
branch-suffix: "timestamp"
|
||||
pricing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.20.2"
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/cache-deps
|
||||
with:
|
||||
extension: reference
|
||||
|
||||
- name: Build Packages
|
||||
run: yarn build
|
||||
|
||||
- name: Install Workspace dependencies
|
||||
run: yarn install
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Build Workspace dependencies
|
||||
run: yarn build
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Generate Pricing Module Reference
|
||||
run: yarn generate:reference pricing
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "chore(docs): Generated Pricing Module Reference (automated)"
|
||||
base: "develop"
|
||||
title: "chore(docs): Generated Pricing Module Reference"
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/docs/content/references/pricing/**
|
||||
branch: "docs/generate-pricing"
|
||||
branch-suffix: "timestamp"
|
||||
product:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.20.2"
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/cache-deps
|
||||
with:
|
||||
extension: reference
|
||||
|
||||
- name: Build Packages
|
||||
run: yarn build
|
||||
|
||||
- name: Install Workspace dependencies
|
||||
run: yarn install
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Build Workspace dependencies
|
||||
run: yarn build
|
||||
working-directory: docs-util
|
||||
|
||||
- name: Generate Product Module Reference
|
||||
run: yarn generate:reference product
|
||||
working-directory: docs-util/packages/scripts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "chore(docs): Generated Product Module Reference (automated)"
|
||||
base: "develop"
|
||||
title: "chore(docs): Generated Product Module Reference"
|
||||
labels: "type: chore"
|
||||
add-paths: www/apps/docs/content/references/product/**
|
||||
branch: "docs/generate-product"
|
||||
branch-suffix: "timestamp"
|
||||
Reference in New Issue
Block a user