Skip to content

docs: allow publishing docs from forked PRs#327

Merged
AlexanderLanin merged 6 commits intoeclipse-score:mainfrom
qorix-group:dcalavrezo_docs_pr_preview
Feb 12, 2025
Merged

docs: allow publishing docs from forked PRs#327
AlexanderLanin merged 6 commits intoeclipse-score:mainfrom
qorix-group:dcalavrezo_docs_pr_preview

Conversation

@dcalavrezo-qorix
Copy link
Contributor

@dcalavrezo-qorix dcalavrezo-qorix commented Feb 10, 2025

Fixes issues with race conditions by enabling folder cleaning
Requires maintainer approval via an environment.
Adapt workflows to correctly handle pull_request_target by explicitly checking out the correct repository.
Flattened folder structure

gh-pages/
.................
│─ pr-42/ # PR #42 preview
│─ pr-99/ # PR #99 preview
│─ feature-x/ # Feature branch preview
│─ v17/ # Tagged release
│─ main/ # main branch (alternatively "latest")

In addition to this repo, there are a couple more changes that are needed:

  • the otterdog repo has to be updated and add the proper maintainers to the github-pages env
  • the eclipse-score.github.io repo has to be updated so that the Docs URL references the /main folder by default

closes #168 #194 #269

Fixes issues with race conditions by enabling folder cleaning
Requires maintainer approval via an environment.
Adapt workflows to correctly handle pull_request_target by explicitly checking out the correct repository.
Flattened folder structure

gh-pages/
.................
│─ pr-42/         # PR eclipse-score#42 preview
│─ pr-99/         # PR eclipse-score#99 preview
│─ feature-x/     # Feature branch preview
│─ v17/           # Tagged release
│─ main/          # main branch (alternatively "latest")

In addition to this repo, there are a couple more changes that are needed:
- the otterdog repo has to be updated and add the proper maintainers to the github-pages env
- the eclipse-score.github.io repo has to be updated so that the Docs refrences the /main folder by default

closes eclipse-score#168 eclipse-score#194 eclipse-score#269

Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
@dcalavrezo-qorix dcalavrezo-qorix marked this pull request as ready for review February 10, 2025 16:07
Copy link
Member

@AlexanderLanin AlexanderLanin left a comment

Choose a reason for hiding this comment

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

Sorry, even more questions

@AlexanderLanin AlexanderLanin added community:infrastructure General Score infrastructure topics docs-as-code labels Feb 10, 2025
Addressed PR comments.
- use base action when performing deployment
- added extra comments

Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
@dcalavrezo-qorix
Copy link
Contributor Author

Sorry, even more questions

No worries, they are very helpful and improved the PR.
Thank you for taking the time to review it.

cancel-in-progress: false
runs-on: ubuntu-latest
needs: docs-build
environment: github-pages # Requires approval before execution
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed the entire idea / concept should be documented somewhere. (separate PR, so we can get this one finally merged)

Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
AlexanderLanin
AlexanderLanin previously approved these changes Feb 11, 2025
@AlexanderLanin
Copy link
Member

AlexanderLanin commented Feb 11, 2025

open points:

Since we execute the action from the base repo, we don't need maintainers to trigger the workflow executions.

Signed-off-by: Dan Calavrezo <dan.calavrezo.ext@qorix.ai>
@AlexanderLanin
Copy link
Member

@dcalavrezo-qorix
Copy link
Contributor Author

Yes, a /main folder will be created after the merge

the index.html from the root will have to be updated: on the gh-pages:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="0; URL=main/">
    <title>Redirecting...</title>
</head>
<body>
    <p>If you are not redirected, <a href="main/">click here</a>.</p>
</body>
</html>

@AlexanderLanin AlexanderLanin merged commit a8e9df9 into eclipse-score:main Feb 12, 2025
4 checks passed
@AlexanderLanin AlexanderLanin moved this from In Progress to Done in INF - Infrastructure Community Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community:infrastructure General Score infrastructure topics docs-as-code

Projects

Development

Successfully merging this pull request may close these issues.

docs cleanup: custom action

2 participants