Skip to content

Commit 76bddbd

Browse files
authored
Merge pull request #112 from Chisanan232/develop
[CU-86evatwcy] Improve the document relative CI/CD workflows
2 parents f3fb669 + 4894e03 commit 76bddbd

12 files changed

+61
-111
lines changed

.github/workflows/docs-build-check.yaml

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
# Documentation CI workflow
77
- ".github/workflows/docs-build-check.yaml"
88
- ".github/workflows/documentation.yaml"
9+
- ".github/workflows/rw_docusaurus_operations.yaml"
910
# Documentation dependencies
1011
- "docs/package.json"
1112
- "docs/pnpm-lock.yaml"
@@ -38,62 +39,28 @@ concurrency:
3839
cancel-in-progress: true
3940

4041
jobs:
41-
build_docs:
42-
name: Build Documentation
42+
build_and_test_docs:
43+
name: Build & Test Documentation
44+
uses: ./.github/workflows/rw_docusaurus_operations.yaml
45+
with:
46+
operation: test
47+
node-version: '22'
48+
working-directory: docs
49+
upload-artifacts: true
50+
51+
validate_build:
52+
name: Validate Build Quality
53+
needs: build_and_test_docs
4354
runs-on: ubuntu-latest
44-
4555
steps:
46-
- name: Checkout repository
47-
uses: actions/checkout@v5
48-
with:
49-
fetch-depth: 1 # Shallow clone for build check
50-
51-
- name: Install pnpm
52-
uses: pnpm/action-setup@v4
56+
- name: Download build artifacts
57+
uses: actions/download-artifact@v6
5358
with:
54-
version: 10
55-
run_install: false
56-
57-
- name: Setup Node.js
58-
uses: actions/setup-node@v6
59-
with:
60-
node-version: '22'
61-
cache: 'pnpm'
62-
cache-dependency-path: docs/pnpm-lock.yaml
63-
64-
- name: Install dependencies
65-
working-directory: ./docs
66-
run: pnpm install --frozen-lockfile
67-
68-
# - name: Type check
69-
# working-directory: ./docs
70-
# run: pnpm typecheck
71-
72-
- name: Build documentation
73-
working-directory: ./docs
74-
run: pnpm build
75-
76-
- name: Check build output
77-
run: |
78-
if [ ! -d "docs/build" ]; then
79-
echo "❌ Build directory not found!"
80-
exit 1
81-
fi
82-
83-
if [ ! -f "docs/build/index.html" ]; then
84-
echo "❌ Main index.html not generated!"
85-
exit 1
86-
fi
87-
88-
# Check for common build artifacts
89-
BUILD_SIZE=$(du -sh docs/build | cut -f1)
90-
echo "✅ Documentation built successfully!"
91-
echo "📁 Build size: $BUILD_SIZE"
92-
echo "📄 Files generated: $(find docs/build -type f | wc -l)"
59+
name: documentation-build
60+
path: docs/build
9361

9462
- name: Validate build quality
9563
run: |
96-
# Check for broken links in build output (basic validation)
9764
cd docs/build
9865
9966
# Count HTML files

.github/workflows/documentation.yaml

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
# Documentation
1010
# Doc - CI workflow
1111
- ".github/workflows/documentation.yaml"
12+
- ".github/workflows/rw_docusaurus_operations.yaml"
1213
- "scripts/ci/**documentation**.sh"
1314
# Doc - Font-End config
1415
- "docs/package.json"
@@ -90,61 +91,43 @@ jobs:
9091
echo "should_deploy=false" >> $GITHUB_OUTPUT
9192
fi
9293
93-
deploy_documentation:
94-
runs-on: ubuntu-latest
95-
# Run based on the check_docs_changes job output (which handles both push and workflow_run events)
94+
build_documentation:
95+
name: Build Documentation
9696
if: needs.check_docs_changes.outputs.should_deploy == 'true'
9797
needs: [check_docs_changes]
98-
steps:
99-
- name: Checkout
100-
uses: actions/checkout@v5
101-
with:
102-
fetch-depth: 0
103-
104-
# Setup pnpm first
105-
- name: Install pnpm
106-
uses: pnpm/action-setup@v4
107-
with:
108-
version: 10
109-
run_install: false
110-
111-
# Then setup Node.js with pnpm cache
112-
- name: Setup Node.js
113-
uses: actions/setup-node@v6
114-
with:
115-
node-version: '22'
116-
cache: 'pnpm'
117-
cache-dependency-path: docs/pnpm-lock.yaml
98+
uses: ./.github/workflows/rw_docusaurus_operations.yaml
99+
with:
100+
operation: build
101+
node-version: '22'
102+
working-directory: docs
103+
upload-artifacts: true
118104

119-
- name: Cache Docusaurus build
120-
uses: actions/cache@v4
105+
deploy_to_github_pages:
106+
name: Deploy to GitHub Pages
107+
runs-on: ubuntu-latest
108+
if: needs.check_docs_changes.outputs.should_deploy == 'true'
109+
needs: [check_docs_changes, build_documentation]
110+
steps:
111+
- name: Download build artifacts
112+
uses: actions/download-artifact@v6
121113
with:
122-
path: |
123-
docs/.docusaurus
124-
docs/node_modules/.cache
125-
key: ${{ runner.os }}-docusaurus-${{ hashFiles('docs/pnpm-lock.yaml') }}
126-
restore-keys: |
127-
${{ runner.os }}-docusaurus-
128-
129-
- name: Install dependencies
130-
working-directory: docs
131-
run: pnpm install --no-frozen-lockfile
132-
133-
- name: Build website
134-
working-directory: docs
135-
run: pnpm build
114+
name: documentation-build
115+
path: ./docs/build
136116

137-
# Setup Pages
138117
- name: Setup Pages
139118
uses: actions/configure-pages@v5
140119

141-
# Upload artifact
142-
- name: Upload artifact
120+
- name: Upload Pages artifact
143121
uses: actions/upload-pages-artifact@v4
144122
with:
145123
path: ./docs/build
146124

147-
# Deploy to GitHub Pages
148125
- name: Deploy to GitHub Pages
149126
id: deployment
150127
uses: actions/deploy-pages@v4
128+
129+
- name: Deployment summary
130+
run: |
131+
echo "## 📚 Documentation Deployment" >> $GITHUB_STEP_SUMMARY
132+
echo "✅ Successfully deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
133+
echo "🔗 **URL**: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/rw_release_complete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ jobs:
425425
docker-run-options: ${{ needs.config.outputs.docker_run_options }}
426426

427427
release_docs:
428-
uses: ./.github/workflows/rw_docs_operations.yaml
428+
uses: ./.github/workflows/rw_docusaurus_operations.yaml
429429
needs: [config, intent, prepare_docs_matrix, bump_version, build_git-tag_and_create_github-release]
430430
if: needs.intent.outputs.do_release == 'true' && needs.intent.outputs.docs != 'skip' && needs.prepare_docs_matrix.outputs.has_sections == 'true'
431431
with:

.github/workflows/rw_release_staging_complete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
docker-run-options: ${{ needs.config.outputs.docker_run_options }}
172172

173173
docs-preview:
174-
uses: ./.github/workflows/rw_docs_operations.yaml
174+
uses: ./.github/workflows/rw_docusaurus_operations.yaml
175175
needs: [config, compute-version]
176176
with:
177177
operation: 'deploy-preview'

.github/workflows/rw_release_validation_complete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
docker-run-options: ${{ needs.config.outputs.docker_run_options }}
134134

135135
docs-build:
136-
uses: ./.github/workflows/rw_docs_operations.yaml
136+
uses: ./.github/workflows/rw_docusaurus_operations.yaml
137137
needs: [config, intent-parse]
138138
with:
139139
operation: 'test'

docs/contents/document/sidebars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ const sidebars: SidebarsConfig = {
159159
items: [
160160
{
161161
type: 'doc',
162-
id: 'workflows/document/rw_docs_operations',
163-
label: 'Docs Operations',
162+
id: 'workflows/document/rw_docusaurus_operations',
163+
label: 'Docusaurus Operations',
164164
},
165165
{
166166
type: 'doc',

docs/contents/document/workflows/document/rw_documentation_deployment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ jobs:
5959
6060
## Related Workflows
6161
62-
- [rw_docs_operations](rw_docs_operations.mdx) - Documentation operations
62+
- [rw_docusaurus_operations](rw_docusaurus_operations.mdx) - Docusaurus operations
6363
- [Documentation Pipeline](/dev/next/ci-cd/documentation-deployment) - Complete pipeline

docs/contents/document/workflows/document/rw_docs_operations.mdx renamed to docs/contents/document/workflows/document/rw_docusaurus_operations.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
id: rw_docs_operations
3-
title: Documentation Operations Workflow
2+
id: rw_docusaurus_operations
3+
title: Docusaurus Operations Workflow
44
sidebar_position: 18
55
---
66

7-
# Documentation Operations Workflow
7+
# Docusaurus Operations Workflow
88

9-
[![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)
9+
[![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)
1010

1111
Build and deploy documentation using Docusaurus or other documentation frameworks.
1212

@@ -37,7 +37,7 @@ This workflow handles documentation building, versioning, and deployment operati
3737
```yaml
3838
jobs:
3939
docs:
40-
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
40+
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
4141
with:
4242
operation: build
4343
docs_path: docs
@@ -48,7 +48,7 @@ jobs:
4848
```yaml
4949
jobs:
5050
docs:
51-
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
51+
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
5252
with:
5353
operation: deploy
5454
docs_path: docs
@@ -59,7 +59,7 @@ jobs:
5959
```yaml
6060
jobs:
6161
docs:
62-
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docs_operations.yaml@master
62+
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_docusaurus_operations.yaml@master
6363
with:
6464
operation: version
6565
version_name: '1.0.0'

docs/contents/document/workflows/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ All workflow source code is available in the [GitHub repository](https://github.
6565
[![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)
6666

6767
### Documentation Workflows
68-
- **[rw_docs_operations](./document/rw_docs_operations.mdx)** - Build and deploy documentation<br/>
69-
[![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)
68+
- **[rw_docusaurus_operations](./document/rw_docusaurus_operations.mdx)** - Build and deploy Docusaurus documentation<br/>
69+
[![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)
7070
- **[rw_documentation_deployment](./document/rw_documentation_deployment.mdx)** - Deploy documentation to GitHub Pages<br/>
7171
[![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)
7272

@@ -201,6 +201,6 @@ Below is a complete list of all available reusable workflows with direct links t
201201
| `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) |
202202
| `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) |
203203
| `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) |
204-
| `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) |
204+
| `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) |
205205
| `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) |
206206
| `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) |

0 commit comments

Comments
 (0)