Files
medusa-store/.github/workflows/generate-references.yml
Shahed Nasser 1c3faee158 docs: fix documentation actions (#5316)
* docs: fix documentation utility scripts

* change branch names
2023-10-09 12:43:14 +03:00

183 lines
5.1 KiB
YAML

name: Generate Documentation Reference
on:
workflow_dispatch:
release:
types: [published]
jobs:
services:
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: Generate Services Reference
run: yarn generate:reference services
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)"
base: "develop"
title: "chore(docs): Generated Services Reference (automated)"
labels: "type: chore"
add-paths: www/apps/docs/content/references/services/**
branch: "docs/generate-services"
branch-suffix: "timestamp"
api:
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:
token: ${{ secrets.REFERENCE_PAT }}
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: Generate API Reference
run: yarn openapi:generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Generated API Reference"
base: "develop"
title: "chore(docs): Updated API Reference"
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: Generate Entities Reference
run: yarn generate:references 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: Generate Services Reference
run: yarn generate:references 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"