chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser
2024-05-03 17:36:38 +03:00
committed by GitHub
parent 224ebb2154
commit 4fe28f5a95
6187 changed files with 601447 additions and 598226 deletions

View File

@@ -1,58 +0,0 @@
name: Generate Docs Release Announcement Bar
on:
release:
types: [published]
jobs:
add-announcement:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.REFERENCE_PAT }}
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.10.0"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: docs-release
- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
- name: Build Workspace packages
run: yarn build
working-directory: docs-util
- name: Generate Announcement Bar
run: yarn generate:announcement
working-directory: docs-util/packages/scripts
- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Generated Docs Announcement Bar (automated)"
base: "develop"
title: "chore(docs): Generated Docs Announcement Bar (automated)"
labels: "type: chore"
add-paths: www/apps/docs/**
branch: "docs/generate-announcement"
branch-suffix: "timestamp"

View File

@@ -1,59 +0,0 @@
# Checks if the announcement bar info was last edited more than 6 days ago, and if so removes it
name: Remove Docs Release Announcement Bar
on:
schedule:
- cron: "0 0 * * *"
jobs:
remove-announcement:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.REFERENCE_PAT }}
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.10.0"
cache: "yarn"
- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: docs-remove-announcement
- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
- name: Build Workspace packages
run: yarn build
working-directory: docs-util
- name: Remove Announcement Bar
run: yarn generate:announcement --expire
working-directory: docs-util/packages/scripts
- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore(docs): Removed Docs Announcement Bar (automated)"
base: "develop"
title: "chore(docs): Removed Docs Announcement Bar (automated)"
labels: "type: chore"
add-paths: www/apps/docs/**
branch: "docs/remove-announcement"
branch-suffix: "timestamp"

View File

@@ -5,7 +5,7 @@ on:
- www/**
jobs:
docs-test:
apps-test:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
steps:
@@ -34,14 +34,11 @@ jobs:
working-directory: www
run: yarn install
- name: Build Docusaurus website
- name: Build Doc Apps
working-directory: www
env:
NODE_OPTIONS: "--max-old-space-size=8192"
API_URL: "https://docs.medusajs.com"
run: yarn build:docs
run: yarn build
vale-docs:
vale-book:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
steps:
@@ -55,9 +52,29 @@ jobs:
with:
fetch-depth: 0
- name: Install docs-util Dependencies
run: yarn
working-directory: docs-util
- name: Build packages
run: yarn build
working-directory: docs-util
# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
# we retrieve the number of changed files
# and only run the linter if the number is
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh docs content references
run: ./get-files.sh book app
id: directories
- name: Vale Linter
@@ -72,6 +89,91 @@ jobs:
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-resources:
if: ${{ startsWith(github.head_ref, 'docs/') }}
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
# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
# we retrieve the number of changed files
# and only run the linter if the number is
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files
- name: Get Directories to Scan
working-directory: www/vale
run: ./get-files.sh resources app contribution-guidelines usage
id: directories
- name: Vale Linter
uses: errata-ai/vale-action@reviewdog
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-user-guide:
if: ${{ startsWith(github.head_ref, 'docs/') }}
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
# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
# we retrieve the number of changed files
# and only run the linter if the number is
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files
- name: Get Directories to Scan
working-directory: www/vale
run: ./get-files.sh user-guide app
id: directories
- name: Vale Linter
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
uses: errata-ai/vale-action@reviewdog
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
vale-ui:
if: ${{ startsWith(github.head_ref, 'docs/') }}
runs-on: ubuntu-latest
@@ -86,13 +188,34 @@ jobs:
with:
fetch-depth: 0
- name: Install docs-util Dependencies
run: yarn
working-directory: docs-util
- name: Build packages
run: yarn build
working-directory: docs-util
# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
# we retrieve the number of changed files
# and only run the linter if the number is
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh ui src/content/docs
id: directories
- name: Vale Linter
uses: errata-ai/vale-action@reviewdog
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
@@ -117,20 +240,41 @@ jobs:
with:
fetch-depth: 0
- name: Install docs-util Dependencies
run: yarn
working-directory: docs-util
- name: Build packages
run: yarn build
working-directory: docs-util
# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
# we retrieve the number of changed files
# and only run the linter if the number is
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files
- name: Get Directories to Scan
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
working-directory: www/vale
run: ./get-files.sh api-reference app/_mdx
id: directories
- name: Vale Linter
uses: errata-ai/vale-action@reviewdog
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
with:
files: ${{ steps.directories.outputs.LIST }}
fail_on_error: true
vale_flags: '--minAlertLevel=error'
reporter: github-pr-check
token: ${{ github.token }}
filter_mode: nofilter
filter_mode: diff_context
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}

View File

@@ -56,13 +56,13 @@ jobs:
- name: Generate References
if: ${{ github.event_name == 'workflow_dispatch' }}
run: "yarn generate:reference ${{ github.event.inputs.referenceName }}"
working-directory: docs-util/packages/scripts
run: "yarn start generate ${{ github.event.inputs.referenceName }} --merge"
working-directory: docs-util/packages/typedoc-generate-references
- name: Generate References
if: ${{ github.event_name != 'workflow_dispatch' }}
run: "yarn generate:reference all"
working-directory: docs-util/packages/scripts
run: "yarn start generate all --merge"
working-directory: docs-util/packages/typedoc-generate-references
- name: Generate Changeset
run: "yarn generate:changeset"
@@ -80,7 +80,7 @@ jobs:
base: "develop"
title: "chore(docs): Generated References"
labels: "type: chore"
add-paths: www/apps/docs/content/references/**
add-paths: www/apps/resources/references/**
branch: "docs/generate-reference"
branch-suffix: "timestamp"
body: ${{ steps.pr-message.outputs.body }}

View File

@@ -1,4 +1,4 @@
name: Generate Automated Documentation
name: Generate Public References
on:
workflow_dispatch:
inputs: