Skip to content

Migrate docs workflows from preview-build to docs-actions#558

Open
Mpdreamz wants to merge 4 commits intomainfrom
migrate-docs-actions
Open

Migrate docs workflows from preview-build to docs-actions#558
Mpdreamz wants to merge 4 commits intomainfrom
migrate-docs-actions

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

Summary

Migrates the docs CI/CD workflows from the monolithic elastic/docs-builder preview-build.yml to the new two-phase architecture in elastic/docs-actions:

  • docs-build.yml (Phase 1) — runs on pull_request / push with read-only permissions for build validation, link checking, and vale linting
  • docs-deploy.yml (Phase 2) — runs via workflow_run from the default branch with elevated permissions for preview deployments, PR comments, and link index updates
  • docs-preview-cleanup.yml — runs on pull_request_target: [closed] to clean up deployments and S3 preview objects

Removes the old docs-cleanup.yml that called docs-builder's preview-cleanup.yml.

References

Post-merge

  • Update branch protection rules to require docs-build instead of preview-build (if applicable)

Made with Cursor

Replace the monolithic preview-build.yml caller with the new two-phase
workflow architecture from elastic/docs-actions:

- docs-build.yml (Phase 1): read-only build validation on PRs and push
- docs-deploy.yml (Phase 2): privileged deploy via workflow_run
- docs-preview-cleanup.yml: cleanup on PR close

Removes the old docs-cleanup.yml that called docs-builder's
preview-cleanup workflow.

Part of elastic/docs-eng-team#474

Made-with: Cursor
@Mpdreamz Mpdreamz requested a review from a team as a code owner March 25, 2026 13:31
@github-actions
Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

v1v
v1v previously approved these changes Mar 25, 2026
Repos with restrictive default token permissions need the caller
to explicitly grant what the reusable workflows require.

Made-with: Cursor
Copy link
Copy Markdown

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Mpdreamz added a commit to elastic/docs-actions that referenced this pull request Mar 26, 2026
When repositories migrate from elastic/docs-builder's preview-build.yml
to elastic/docs-actions' docs-build.yml, both the old and new workflows
coexist temporarily:

- The OLD workflow (on the base branch) triggers via pull_request_target
  and calls preview-build.yml, which defines a concurrency group of
  `${github.workflow}-${branch}`.

- The NEW workflow (on the PR branch) triggers via pull_request and calls
  docs-build.yml, which defined the same concurrency group pattern.

Because both caller workflows typically share the same `name: docs-build`,
they resolve to identical concurrency groups. Both have
cancel-in-progress: true for PR events, so whichever starts second
cancels the first — causing the old workflow's jobs to show as
"cancelled" on the PR checks.

This was observed on elastic/ecs-dotnet#558, where every commit showed
the pull_request_target docs-build run cancelled by the pull_request run
(e.g. commit 3f57a7d: the pull_request_target run started at 14:48:00,
the pull_request run started 3 seconds later and cancelled it).

Adding a `docs-actions-build-` prefix to the concurrency group makes it
distinct from preview-build.yml's group, so both workflows run
independently during the migration window.

Made-with: Cursor
Mpdreamz added a commit to elastic/docs-actions that referenced this pull request Mar 26, 2026
…ion (#33)

When repositories migrate from elastic/docs-builder's preview-build.yml
to elastic/docs-actions' docs-build.yml, both the old and new workflows
coexist temporarily:

- The OLD workflow (on the base branch) triggers via pull_request_target
  and calls preview-build.yml, which defines a concurrency group of
  `${github.workflow}-${branch}`.

- The NEW workflow (on the PR branch) triggers via pull_request and calls
  docs-build.yml, which defined the same concurrency group pattern.

Because both caller workflows typically share the same `name: docs-build`,
they resolve to identical concurrency groups. Both have
cancel-in-progress: true for PR events, so whichever starts second
cancels the first — causing the old workflow's jobs to show as
"cancelled" on the PR checks.

This was observed on elastic/ecs-dotnet#558, where every commit showed
the pull_request_target docs-build run cancelled by the pull_request run
(e.g. commit 3f57a7d: the pull_request_target run started at 14:48:00,
the pull_request run started 3 seconds later and cancelled it).

Adding a `docs-actions-build-` prefix to the concurrency group makes it
distinct from preview-build.yml's group, so both workflows run
independently during the migration window.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants