Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 17 additions & 50 deletions .github/workflows/docs-build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
# Documentation CI workflow
- ".github/workflows/docs-build-check.yaml"
- ".github/workflows/documentation.yaml"
- ".github/workflows/rw_docusaurus_operations.yaml"
# Documentation dependencies
- "docs/package.json"
- "docs/pnpm-lock.yaml"
Expand Down Expand Up @@ -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_docusaurus_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
Expand Down
69 changes: 26 additions & 43 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
# Documentation
# Doc - CI workflow
- ".github/workflows/documentation.yaml"
- ".github/workflows/rw_docusaurus_operations.yaml"
- "scripts/ci/**documentation**.sh"
# Doc - Font-End config
- "docs/package.json"
Expand Down Expand Up @@ -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_docusaurus_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
2 changes: 1 addition & 1 deletion .github/workflows/rw_release_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rw_release_staging_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rw_release_validation_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions docs/contents/document/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
id: rw_docs_operations
title: Documentation Operations Workflow
id: rw_docusaurus_operations
title: Docusaurus Operations Workflow
sidebar_position: 18
---

# Documentation Operations Workflow
# 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_docs_operations.yaml)
[![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.

Expand Down Expand Up @@ -37,7 +37,7 @@ This workflow handles documentation building, versioning, and deployment operati
```yaml
jobs:
docs:
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
with:
operation: build
docs_path: docs
Expand All @@ -48,7 +48,7 @@ jobs:
```yaml
jobs:
docs:
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
with:
operation: deploy
docs_path: docs
Expand All @@ -59,7 +59,7 @@ jobs:
```yaml
jobs:
docs:
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
with:
operation: version
version_name: '1.0.0'
Expand Down
6 changes: 3 additions & 3 deletions docs/contents/document/workflows/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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<br/>
[![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<br/>
[![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<br/>
[![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)

Expand Down Expand Up @@ -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) |
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```
Expand Down
Loading