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

@@ -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 }}