Skip to content

Re Implement per-pull-request preview deployments#2355

Merged
jcstein merged 2 commits intomainfrom
gb/add-pr-preview
Dec 16, 2025
Merged

Re Implement per-pull-request preview deployments#2355
jcstein merged 2 commits intomainfrom
gb/add-pr-preview

Conversation

@gbarros
Copy link
Copy Markdown
Contributor

@gbarros gbarros commented Dec 16, 2025

This pull request updates the GitHub Actions workflow for deploying documentation previews. The workflow is now triggered on pull request events instead of branch pushes, generates a unique preview for each PR, automatically posts (and updates) preview links in the PR, and cleans up previews when PRs are closed. These changes improve the preview deployment process, making it more robust, automated, and user-friendly.

Workflow trigger and structure improvements:

  • The workflow is now triggered on pull request events (opened, reopened, synchronized, closed) instead of on branch pushes, and the job names and concurrency groups have been updated to reflect per-PR deployments.

Per-PR preview deployment:

  • The build and deployment steps now generate a unique directory for each PR (e.g., /docs-preview/pr-<PR_NUMBER>/), ensuring that each PR gets its own isolated preview. [1] [2]
  • The deployment logic was refactored to cleanly remove and recreate the target preview directory before copying new files, ensuring no stale files are left over.

Automated preview link posting and cleanup:

  • After deploying, the workflow automatically posts (or updates) a comment on the PR with a link to the preview, using the actions/github-script action.
  • When a PR is closed, a new cleanup-preview job runs to remove the corresponding preview directory and commit the removal to the docs-preview repository.

@gbarros gbarros requested a review from jcstein December 16, 2025 20:01
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Comment thread .github/workflows/preview.yaml Fixed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 16, 2025

🚀 Preview Deployment

Your preview is ready: https://celestiaorg.github.io/docs-preview/pr-2355/

Copy link
Copy Markdown
Member

@jcstein jcstein left a comment

Choose a reason for hiding this comment

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

:shipit:

@jcstein jcstein merged commit edc2cab into main Dec 16, 2025
6 checks passed
@jcstein jcstein deleted the gb/add-pr-preview branch December 16, 2025 20:49
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