From 3440651fbcf6e8ad507da1ccebdcbe466ab848c0 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Wed, 29 Oct 2025 21:01:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Change=20to=20reuse=20?= =?UTF-8?q?the=20document=20operation=20reusable=20workflow=20to=20build?= =?UTF-8?q?=20and=20deploy=20documentation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/documentation.yaml | 69 +++++++++++----------------- 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 9036838b..6edba8d7 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -9,6 +9,7 @@ on: # Documentation # Doc - CI workflow - ".github/workflows/documentation.yaml" + - ".github/workflows/rw_docs_operations.yaml" - "scripts/ci/**documentation**.sh" # Doc - Font-End config - "docs/package.json" @@ -90,61 +91,43 @@ jobs: echo "should_deploy=false" >> $GITHUB_OUTPUT fi - deploy_documentation: - runs-on: ubuntu-latest - # Run based on the check_docs_changes job output (which handles both push and workflow_run events) + build_documentation: + name: Build Documentation if: needs.check_docs_changes.outputs.should_deploy == 'true' needs: [check_docs_changes] - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - # Setup pnpm first - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - run_install: false - - # Then setup Node.js with pnpm cache - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: '22' - cache: 'pnpm' - cache-dependency-path: docs/pnpm-lock.yaml + uses: ./.github/workflows/rw_docs_operations.yaml + with: + operation: build + node-version: '22' + working-directory: docs + upload-artifacts: true - - name: Cache Docusaurus build - uses: actions/cache@v4 + deploy_to_github_pages: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + if: needs.check_docs_changes.outputs.should_deploy == 'true' + needs: [check_docs_changes, build_documentation] + steps: + - name: Download build artifacts + uses: actions/download-artifact@v6 with: - path: | - docs/.docusaurus - docs/node_modules/.cache - key: ${{ runner.os }}-docusaurus-${{ hashFiles('docs/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-docusaurus- - - - name: Install dependencies - working-directory: docs - run: pnpm install --no-frozen-lockfile - - - name: Build website - working-directory: docs - run: pnpm build + name: documentation-build + path: ./docs/build - # Setup Pages - name: Setup Pages uses: actions/configure-pages@v5 - # Upload artifact - - name: Upload artifact + - name: Upload Pages artifact uses: actions/upload-pages-artifact@v4 with: path: ./docs/build - # Deploy to GitHub Pages - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + + - name: Deployment summary + run: | + echo "## 📚 Documentation Deployment" >> $GITHUB_STEP_SUMMARY + echo "✅ Successfully deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY + echo "🔗 **URL**: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY From 5bc6d79380b5a100d786795a3edc9ce256d8d543 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Wed, 29 Oct 2025 21:01:35 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Change=20to=20reuse=20?= =?UTF-8?q?the=20document=20operation=20reusable=20workflow=20to=20test=20?= =?UTF-8?q?building=20documentation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs-build-check.yaml | 67 +++++++------------------ 1 file changed, 17 insertions(+), 50 deletions(-) diff --git a/.github/workflows/docs-build-check.yaml b/.github/workflows/docs-build-check.yaml index 9361bbe6..eaa7126c 100644 --- a/.github/workflows/docs-build-check.yaml +++ b/.github/workflows/docs-build-check.yaml @@ -6,6 +6,7 @@ on: # Documentation CI workflow - ".github/workflows/docs-build-check.yaml" - ".github/workflows/documentation.yaml" + - ".github/workflows/rw_docs_operations.yaml" # Documentation dependencies - "docs/package.json" - "docs/pnpm-lock.yaml" @@ -38,62 +39,28 @@ concurrency: cancel-in-progress: true jobs: - build_docs: - name: Build Documentation + build_and_test_docs: + name: Build & Test Documentation + uses: ./.github/workflows/rw_docs_operations.yaml + with: + operation: test + node-version: '22' + working-directory: docs + upload-artifacts: true + + validate_build: + name: Validate Build Quality + needs: build_and_test_docs runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 1 # Shallow clone for build check - - - name: Install pnpm - uses: pnpm/action-setup@v4 + - name: Download build artifacts + uses: actions/download-artifact@v6 with: - version: 10 - run_install: false - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: '22' - cache: 'pnpm' - cache-dependency-path: docs/pnpm-lock.yaml - - - name: Install dependencies - working-directory: ./docs - run: pnpm install --frozen-lockfile - -# - name: Type check -# working-directory: ./docs -# run: pnpm typecheck - - - name: Build documentation - working-directory: ./docs - run: pnpm build - - - name: Check build output - run: | - if [ ! -d "docs/build" ]; then - echo "❌ Build directory not found!" - exit 1 - fi - - if [ ! -f "docs/build/index.html" ]; then - echo "❌ Main index.html not generated!" - exit 1 - fi - - # Check for common build artifacts - BUILD_SIZE=$(du -sh docs/build | cut -f1) - echo "✅ Documentation built successfully!" - echo "📁 Build size: $BUILD_SIZE" - echo "📄 Files generated: $(find docs/build -type f | wc -l)" + name: documentation-build + path: docs/build - name: Validate build quality run: | - # Check for broken links in build output (basic validation) cd docs/build # Count HTML files From c2527d6ac54baea8b1321cca6391b020f63545ce Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Wed, 29 Oct 2025 21:03:53 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Rename=20the=20reusabl?= =?UTF-8?q?e=20workflow=20to=20be=20more=20clear=20and=20readable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs-build-check.yaml | 4 ++-- .github/workflows/documentation.yaml | 4 ++-- ...{rw_docs_operations.yaml => rw_docusaurus_operations.yaml} | 0 .github/workflows/rw_release_complete.yaml | 2 +- .github/workflows/rw_release_staging_complete.yaml | 2 +- .github/workflows/rw_release_validation_complete.yaml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename .github/workflows/{rw_docs_operations.yaml => rw_docusaurus_operations.yaml} (100%) diff --git a/.github/workflows/docs-build-check.yaml b/.github/workflows/docs-build-check.yaml index eaa7126c..ee801dcd 100644 --- a/.github/workflows/docs-build-check.yaml +++ b/.github/workflows/docs-build-check.yaml @@ -6,7 +6,7 @@ on: # Documentation CI workflow - ".github/workflows/docs-build-check.yaml" - ".github/workflows/documentation.yaml" - - ".github/workflows/rw_docs_operations.yaml" + - ".github/workflows/rw_docusaurus_operations.yaml" # Documentation dependencies - "docs/package.json" - "docs/pnpm-lock.yaml" @@ -41,7 +41,7 @@ concurrency: jobs: build_and_test_docs: name: Build & Test Documentation - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml with: operation: test node-version: '22' diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 6edba8d7..fc3b71a2 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -9,7 +9,7 @@ on: # Documentation # Doc - CI workflow - ".github/workflows/documentation.yaml" - - ".github/workflows/rw_docs_operations.yaml" + - ".github/workflows/rw_docusaurus_operations.yaml" - "scripts/ci/**documentation**.sh" # Doc - Font-End config - "docs/package.json" @@ -95,7 +95,7 @@ jobs: name: Build Documentation if: needs.check_docs_changes.outputs.should_deploy == 'true' needs: [check_docs_changes] - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml with: operation: build node-version: '22' diff --git a/.github/workflows/rw_docs_operations.yaml b/.github/workflows/rw_docusaurus_operations.yaml similarity index 100% rename from .github/workflows/rw_docs_operations.yaml rename to .github/workflows/rw_docusaurus_operations.yaml diff --git a/.github/workflows/rw_release_complete.yaml b/.github/workflows/rw_release_complete.yaml index 035eb02d..094da275 100644 --- a/.github/workflows/rw_release_complete.yaml +++ b/.github/workflows/rw_release_complete.yaml @@ -425,7 +425,7 @@ jobs: docker-run-options: ${{ needs.config.outputs.docker_run_options }} release_docs: - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml needs: [config, intent, prepare_docs_matrix, bump_version, build_git-tag_and_create_github-release] if: needs.intent.outputs.do_release == 'true' && needs.intent.outputs.docs != 'skip' && needs.prepare_docs_matrix.outputs.has_sections == 'true' with: diff --git a/.github/workflows/rw_release_staging_complete.yaml b/.github/workflows/rw_release_staging_complete.yaml index 2ee8d0c2..cc18a29e 100644 --- a/.github/workflows/rw_release_staging_complete.yaml +++ b/.github/workflows/rw_release_staging_complete.yaml @@ -171,7 +171,7 @@ jobs: docker-run-options: ${{ needs.config.outputs.docker_run_options }} docs-preview: - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml needs: [config, compute-version] with: operation: 'deploy-preview' diff --git a/.github/workflows/rw_release_validation_complete.yaml b/.github/workflows/rw_release_validation_complete.yaml index d15e656c..d563fe0f 100644 --- a/.github/workflows/rw_release_validation_complete.yaml +++ b/.github/workflows/rw_release_validation_complete.yaml @@ -133,7 +133,7 @@ jobs: docker-run-options: ${{ needs.config.outputs.docker_run_options }} docs-build: - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml needs: [config, intent-parse] with: operation: 'test' From bd892199b37867cf2e91994d424f85f1e8aaff5a Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Wed, 29 Oct 2025 21:19:41 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Update=20the=20relativ?= =?UTF-8?q?e=20content=20for=20the=20improvement=20in=20the=20document.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/contents/document/sidebars.ts | 4 +- .../workflows/document/rw_docs_operations.mdx | 71 ------------------- .../document/rw_documentation_deployment.mdx | 2 +- docs/contents/document/workflows/index.mdx | 6 +- .../release/rw_release_staging_complete.mdx | 2 +- .../rw_release_validation_complete.mdx | 2 +- 6 files changed, 8 insertions(+), 79 deletions(-) delete mode 100644 docs/contents/document/workflows/document/rw_docs_operations.mdx diff --git a/docs/contents/document/sidebars.ts b/docs/contents/document/sidebars.ts index e6e0c540..a603e5c3 100644 --- a/docs/contents/document/sidebars.ts +++ b/docs/contents/document/sidebars.ts @@ -159,8 +159,8 @@ const sidebars: SidebarsConfig = { items: [ { type: 'doc', - id: 'workflows/document/rw_docs_operations', - label: 'Docs Operations', + id: 'workflows/document/rw_docusaurus_operations', + label: 'Docusaurus Operations', }, { type: 'doc', diff --git a/docs/contents/document/workflows/document/rw_docs_operations.mdx b/docs/contents/document/workflows/document/rw_docs_operations.mdx deleted file mode 100644 index f2b5619c..00000000 --- a/docs/contents/document/workflows/document/rw_docs_operations.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -id: rw_docs_operations -title: Documentation Operations Workflow -sidebar_position: 18 ---- - -# Documentation Operations Workflow - -[![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docs_operations.yaml) - -Build and deploy documentation using Docusaurus or other documentation frameworks. - -## Overview - -This workflow handles documentation building, versioning, and deployment operations for Docusaurus-based documentation sites. - -## When to Use - -- ✅ You use Docusaurus for documentation -- ✅ You need automated documentation deployment -- ✅ You want documentation versioning -- ✅ You need to build documentation on CI - -## Inputs - -| Input | Type | Default | Description | -|-------|------|---------|-------------| -| `operation` | string | `'build'` | Operation (build, deploy, version) | -| `docs_path` | string | `'docs'` | Path to documentation directory | -| `node_version` | string | `'22'` | Node.js version | -| `version_name` | string | `''` | Version name for versioning | - -## Usage Examples - -### Build Documentation - -```yaml -jobs: - docs: - uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master - with: - operation: build - docs_path: docs -``` - -### Deploy to GitHub Pages - -```yaml -jobs: - docs: - uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master - with: - operation: deploy - docs_path: docs -``` - -### Version Documentation - -```yaml -jobs: - docs: - uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master - with: - operation: version - version_name: '1.0.0' -``` - -## Related Workflows - -- [rw_documentation_deployment](rw_documentation_deployment.mdx) - Deploy documentation -- [Documentation Pipeline](/dev/next/ci-cd/documentation-deployment) - Complete pipeline diff --git a/docs/contents/document/workflows/document/rw_documentation_deployment.mdx b/docs/contents/document/workflows/document/rw_documentation_deployment.mdx index 14e65ac1..3b1e8952 100644 --- a/docs/contents/document/workflows/document/rw_documentation_deployment.mdx +++ b/docs/contents/document/workflows/document/rw_documentation_deployment.mdx @@ -59,5 +59,5 @@ jobs: ## Related Workflows -- [rw_docs_operations](rw_docs_operations.mdx) - Documentation operations +- [rw_docusaurus_operations](rw_docusaurus_operations.mdx) - Docusaurus operations - [Documentation Pipeline](/dev/next/ci-cd/documentation-deployment) - Complete pipeline diff --git a/docs/contents/document/workflows/index.mdx b/docs/contents/document/workflows/index.mdx index 4829828c..40e8e9e7 100644 --- a/docs/contents/document/workflows/index.mdx +++ b/docs/contents/document/workflows/index.mdx @@ -65,8 +65,8 @@ All workflow source code is available in the [GitHub repository](https://github. [![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docker_operations.yaml) ### Documentation Workflows -- **[rw_docs_operations](./document/rw_docs_operations.mdx)** - Build and deploy documentation
- [![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docs_operations.yaml) +- **[rw_docusaurus_operations](./document/rw_docusaurus_operations.mdx)** - Build and deploy Docusaurus documentation
+ [![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docusaurus_operations.yaml) - **[rw_documentation_deployment](./document/rw_documentation_deployment.mdx)** - Deploy documentation to GitHub Pages
[![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_documentation_deployment.yaml) @@ -201,6 +201,6 @@ Below is a complete list of all available reusable workflows with direct links t | `rw_release_staging_complete.yaml` | Release | Staging release workflow | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_release_staging_complete.yaml) | | `rw_release_validation_complete.yaml` | Release | Validation release workflow | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_release_validation_complete.yaml) | | `rw_docker_operations.yaml` | Docker | Build and publish Docker images | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docker_operations.yaml) | -| `rw_docs_operations.yaml` | Documentation | Build and deploy documentation | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docs_operations.yaml) | +| `rw_docusaurus_operations.yaml` | Documentation | Build and deploy Docusaurus docs | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docusaurus_operations.yaml) | | `rw_documentation_deployment.yaml` | Documentation | Deploy docs to GitHub Pages | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_documentation_deployment.yaml) | | `rw_sonarqube_scan.yaml` | Code Quality | SonarQube/SonarCloud analysis | [View](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_sonarqube_scan.yaml) | diff --git a/docs/contents/document/workflows/release/rw_release_staging_complete.mdx b/docs/contents/document/workflows/release/rw_release_staging_complete.mdx index fcc8a1be..e5837169 100644 --- a/docs/contents/document/workflows/release/rw_release_staging_complete.mdx +++ b/docs/contents/document/workflows/release/rw_release_staging_complete.mdx @@ -245,7 +245,7 @@ docker-ghcr-staging: ```yaml docs-preview: - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml with: operation: 'deploy' branch: ${{ needs.config.outputs.docs_preview_branch }} diff --git a/docs/contents/document/workflows/release/rw_release_validation_complete.mdx b/docs/contents/document/workflows/release/rw_release_validation_complete.mdx index 299f29dd..ea49433e 100644 --- a/docs/contents/document/workflows/release/rw_release_validation_complete.mdx +++ b/docs/contents/document/workflows/release/rw_release_validation_complete.mdx @@ -187,7 +187,7 @@ docker-build-ghcr: ```yaml docs-build: - uses: ./.github/workflows/rw_docs_operations.yaml + uses: ./.github/workflows/rw_docusaurus_operations.yaml with: operation: 'build' ``` From 4894e03f82bc58826e52d87c3dd973cbe760d11a Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Wed, 29 Oct 2025 21:23:24 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E2=9E=95=20Add=20the=20missing=20page=20of?= =?UTF-8?q?=20the=20new=20page=20(rename).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../document/rw_docusaurus_operations.mdx | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 docs/contents/document/workflows/document/rw_docusaurus_operations.mdx diff --git a/docs/contents/document/workflows/document/rw_docusaurus_operations.mdx b/docs/contents/document/workflows/document/rw_docusaurus_operations.mdx new file mode 100644 index 00000000..3d8f730b --- /dev/null +++ b/docs/contents/document/workflows/document/rw_docusaurus_operations.mdx @@ -0,0 +1,71 @@ +--- +id: rw_docusaurus_operations +title: Docusaurus Operations Workflow +sidebar_position: 18 +--- + +# Docusaurus Operations Workflow + +[![View Source](https://img.shields.io/badge/View-Source-blue?logo=github)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/blob/master/.github/workflows/rw_docusaurus_operations.yaml) + +Build and deploy documentation using Docusaurus or other documentation frameworks. + +## Overview + +This workflow handles documentation building, versioning, and deployment operations for Docusaurus-based documentation sites. + +## When to Use + +- ✅ You use Docusaurus for documentation +- ✅ You need automated documentation deployment +- ✅ You want documentation versioning +- ✅ You need to build documentation on CI + +## Inputs + +| Input | Type | Default | Description | +|-------|------|---------|-------------| +| `operation` | string | `'build'` | Operation (build, deploy, version) | +| `docs_path` | string | `'docs'` | Path to documentation directory | +| `node_version` | string | `'22'` | Node.js version | +| `version_name` | string | `''` | Version name for versioning | + +## Usage Examples + +### Build Documentation + +```yaml +jobs: + docs: + uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master + with: + operation: build + docs_path: docs +``` + +### Deploy to GitHub Pages + +```yaml +jobs: + docs: + uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master + with: + operation: deploy + docs_path: docs +``` + +### Version Documentation + +```yaml +jobs: + docs: + uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master + with: + operation: version + version_name: '1.0.0' +``` + +## Related Workflows + +- [rw_documentation_deployment](rw_documentation_deployment.mdx) - Deploy documentation +- [Documentation Pipeline](/dev/next/ci-cd/documentation-deployment) - Complete pipeline