Also, please create a Github secret, if necessary, with which we can push to the Github pages branch (e.g. gh-pages) from a Github workflow.
Once this is ready, we'll prepare the Github workflows.
Once we are ready, we will ping you again here and ask you to configure theia-ide.org to be the custom domain for the Github page of this repo. But please wait with that until we confirm everything is ready.
this also sounds like a good opportunity to enable self-service (https://www.eclipse.org/projects/handbook/#resources-github-self-service) for your project at GitHub. This will capture the existing configuration as code in a separate repo (.eclipsefdn) and any committers can create PRs against this repo to change the configuration to fit your needs. The PRs will need to be approved by EF staff (and project leads if needed) before being merged and the changes finally being applied to GitHub. Here is for example a PR from another project enabling consistent branch protection rules for all repos: https://github.com/eclipse-velocitas/.eclipsefdn/pull/1 Here you can see a list of all Eclipse project that have this already enabled: https://eclipsefdn.github.io/otterdog-configs/
Please let us know if you'd like to proceed with setting up self-service.
When you want to suggest changes, fork the repo, make changes and create a PR. A workflow will automatically run and show you the changes that will be applied and validate that the configuration is correctly formatted and composed.
The documentation of all supported settings can be found here:
A token for the publish workflow to push the build result from master of Theia website repo to the gh-pages in the same repository.
Can you please arrange for adding those secrets containing the tokens for our workflows?
Thank you very much!
Eventually, once everything works, we need to add theia-ide.org as a custom domain of the Github page at https://eclipse-theia.github.io/theia-website. But before doing, a few things need to be verified and tested (e.g. base URLs of Gatsby builds, etc.). We'll ping you once we are ready for the domain switch.
from what I can see is that the theia-website repo has now switched to deploying pages via workflow. In any case you dont need a separate token for pushing the page to the gh-pages branch, you can configure that in your workflow, see:
The reason for that failure is because the workflow was triggered from a pull_request event from a PR coming from a fork.
In such cases, no secrets or write tokens are available, but the workflow tries to write to the PR to add a comment and push the content ofc to the other repo.
For this purpose there is the pull_request_target trigger, which is dangerous but we gave such workflows a minimal set of permissions to avoid harm.
Furthermore we can adjust settings such that ANY workflow action run from PRs coming from forks needs approval first, but that's up to you at this point. In the long run that should be the default imho. Its a setting not yet supported by the self-service, but we look into supporting it, we can make this change manually for now.
that wont work in general unless the PR comes from a committer or is from a branch in the same repo.
Removing that trigger should make the workflow work imho, it probably takes precedence over the pull_request_target one. Have not seen that before and the GitHub doc is not detailed about such a case, but I assume only one of the 2 will be triggered at the same time.
also afaict, you cant test such a workflow in a PR itself that creates the workflow, as it needs to be present in the default branch as well, if you look at the history at langium you should also see that it started to work once it was merged to main.
@netomi Thank you very much for the fast clarification. That makes sense!
also afaict, you cant test such a workflow in a PR itself that creates the workflow, as it needs to be present in the default branch as well, if you look at the history at langium you should also see that it started to work once it was merged to main.
Yeah, looks like it. I tried (as a committer) to push the same branch without the pull_request: trigger to the same repo and open a PR from there, but it looks like both workflows aren't executed.
See https://github.com/eclipse-theia/theia-website/pull/536
I guess we'll then have to merge those changes and test them from the main branch.
In this case it shouldn't do any harm as the gh-pages aren't really live anyway.
for langium I tested the whole thing in a fork before creating the PR for the langium website itself. I also had to push the workflow first to the main branch. So yes, GitHub Actions have their pitfalls and annoyances as well :-)
Thank you very much @netomi, everything works perfectly now.
We'll just briefly double-check with the Theia project leads and get back to you, but we should be ready to configure the theia-ide.org domain for the GH-page at https://eclipse-theia.github.io/theia-website soon.
@mward After a test period and announcement, we are ready to make the move and switch theia-ide.org to the GH-pages. Can you please change the DNS records?
Thank you very much and let us know if there is anything you need us to do!