-
Notifications
You must be signed in to change notification settings - Fork 63
feat(ci): add PR preview deployment workflow #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(ci): add PR preview deployment workflow #682
Conversation
edb31ef to
18b8cc9
Compare
- Adds PR preview deployment for fork PRs using pull_request_target - Uses JamesIves/github-pages-deploy-action for cross-repo deployment - Implements automatic cleanup when PRs close - Adds sticky PR comments with preview URLs - Includes scheduled cleanup for stale/orphaned previews - Extracts build logic to reusable workflow with dynamic baseUrl - Configures Docusaurus baseUrl dynamically for PR preview paths - Preserves PR preview directory during main docs deployment Ref rucio#658
18b8cc9 to
b543465
Compare
|
Does this use your own account to post the sticky comments? Maybe a link included in the CI would be cleaner. I don't love the idea of the action using your account to make comments on your behalf. |
Good point about the account visibility. Ideally, we'll replace the current About the CI link: Since the sticky comment already displays the preview URL directly in the PR (where developers typically check first), including it in the CI logs feels unnecessary. That said, if you'd prefer having it in the CI output too (using an echo statement or similar) for quick access from the Actions tab, I'll add that. Just let me know if you want it in both places. |
Sorry for the lack of clarity there, I meant either-or. If we have a service account post it instead that would be fine! |
Perfect, thanks for clarifying. I couldn't find an existing service account. I'll ask if we should create one (e.g. If that's not feasible, we could fall back to showing the preview URL only in CI logs (as you suggested) instead of PR comments. That would avoid the personal account issue, though it's less visible and requires extra clicks to access compared to sticky comments in the PR. |
@bari12: Should we create a service account (e.g. rucio-bot or rucio-ci) for this or fall back to showing the preview URL only in the CI logs? If we go with a service account, who could set it up? |
Addresses #658
Some additional information:
Testing & Verification
Fork-to-Fork Testing
To verify the
pull_request_targetworkflow with fork PRs, we conducted the following experiment:Setup fork chain:
mgajek-cern/documentationmain branch (required forpull_request_targetto run)MGTheTrain/documentationsynced withmgajek-cern/documentationMGTheTrain/documentationto verify workflow behaviorVerified deployment functionality:
MGTheTrain/documentation→mgajek-cern/documentationgh-pagesbranchNext Steps
rucio/documentationmgajek-cern), consider using service account PATNote: The
PREVIEW_TOKENPAT has full repo and workflow permissions and is created by an org member, so cross-fork deployment should work as demonstrated.PREVIEW_TOKENis configured as a GitHub secret: https://github.com/rucio/documentation/settings/secrets/actions