Skip to content

Commit d728190

Browse files
themr0cclaude
andcommitted
refactor: rewrite deploy-gh-pages back to bash
The Node.js rewrite was 325 lines for functionality that fits naturally in ~289 lines of bash. The deploy script's core job is git operations (fetch, copy, add, commit, push) which read more naturally in shell. Changes from the original 88-line script: - Rebase-based retry replaces sleep-based retry (instant vs 2+ minutes) - Cleanup of stale PR/branch dirs integrated (was separate workflow step) - Index regeneration integrated (was in build-orchestrator.js) - Token auth via http.extraHeader (was in remote URL, leaked in logs) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 238a361 commit d728190

6 files changed

Lines changed: 300 additions & 336 deletions

File tree

.github/workflows/build-asciidoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474
env:
7575
GITHUB_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}
7676
GITHUB_REPOSITORY: ${{ github.repository }}
77-
run: node build/scripts/deploy-gh-pages.js --publish-dir ./titles-generated --message "Deploy ${{ env.GIT_BRANCH }}"
77+
run: bash build/scripts/deploy-gh-pages.sh --publish-dir ./titles-generated --message "Deploy ${{ env.GIT_BRANCH }}"

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
env:
196196
GITHUB_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}
197197
GITHUB_REPOSITORY: ${{ github.repository }}
198-
run: node trusted-scripts/build/scripts/deploy-gh-pages.js --publish-dir ./pr-content/titles-generated --message "Deploy PR ${{ github.event.number }} preview"
198+
run: bash trusted-scripts/build/scripts/deploy-gh-pages.sh --publish-dir ./pr-content/titles-generated --message "Deploy PR ${{ github.event.number }} preview"
199199

200200
# Post one consolidated PR comment with build results, preview link, and CQA checklist.
201201
# Preview link is always shown; marked stale when title build failed (HTML not generated).

build/scripts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Build, deploy, and content quality tooling for the RHDH documentation project.
88
|---|---|
99
| `build-ccutil.sh` | Wrapper that delegates to `build-orchestrator.js`. Used as a fallback in `pr.yml` on older branches and for local builds. |
1010
| `build-orchestrator.js` | Parallel documentation build orchestrator. Runs ccutil title builds, lychee link validation, and CQA assessment. Produces `build-report.json`. Supports `--no-cqa` and `--no-lychee` flags to skip phases. |
11-
| `deploy-gh-pages.js` | Deploys build output to the `gh-pages` branch. Handles cleanup of stale PR/branch directories, index regeneration with release notes links, and retry with rebase on push conflicts. |
11+
| `deploy-gh-pages.sh` | Deploys build output to the `gh-pages` branch. Handles cleanup of stale PR/branch directories, index regeneration with release notes links, and retry with rebase on push conflicts. |
1212
| `error-patterns.json` | Regex patterns for classifying ccutil build errors into structured messages with cause and fix fields. |
1313
| `update-cqa-resources.sh` | Fetches upstream Red Hat style guide resources into `.claude/resources/`. |
1414

@@ -29,7 +29,7 @@ See `.claude/plugins/project-cqa/resources/cqa-spec.md` for the full specificati
2929

3030
These scripts are called by GitHub Actions workflows in `.github/workflows/`:
3131

32-
- **`build-asciidoc.yml`** (push to main/release) -- `build-orchestrator.js --no-cqa` + `deploy-gh-pages.js`
33-
- **`pr.yml`** (pull requests) -- `build-orchestrator.js` (or `build-ccutil.sh` on older branches) + `deploy-gh-pages.js`
32+
- **`build-asciidoc.yml`** (push to main/release) -- `build-orchestrator.js --no-cqa` + `deploy-gh-pages.sh`
33+
- **`pr.yml`** (pull requests) -- `build-orchestrator.js` (or `build-ccutil.sh` on older branches) + `deploy-gh-pages.sh`
3434

3535
See `docs/github-publication-workflow.md` for the full architecture documentation.

build/scripts/deploy-gh-pages.js

Lines changed: 0 additions & 325 deletions
This file was deleted.

0 commit comments

Comments
 (0)