Open f-hollow opened 5 months ago
The standard page_url
for a repo is <username>.github.io/<reponame>
. Changing this page_url
is not supported, which means that you cannot publish more than one branch from the same repo to githuab pages. I tried two workarounds without luck. Probably, there are more, but these are still workarounds for now. Also, there is a feature request: Deploy preview option for PRs that seems to be dormant.
To make preview useful, we should be able to change page_url
, so that we can have multiple versions of the portal for different PRs.
The standard deployment action actions/deploy-pages
, can only publish to a standard URL <username>.github.io/<reponame>
. The proposed workaround does not work.
The alternative action actions-gh-pages, does not work. I tried changing branches, and I always get remote: Permission to <username>/developer-portal.git denied to github-actions[bot].
We can probably use preview-docs.espressif.com for this. For a PR, an action would build the site and SCP it over to preview-docs.
This would probably be limited to authors who can push branches directly to this repo. It wouldn't work if a PR is done from a fork, because the forked repository wouldn't have access to secrets (e.g. SSH keys) required for deployment. Still, we could add all the regular authors here as contributors and at least for them, the workflow would be simplified.
@hfudev also shared this:
Worth checking:
Accepting fork PRs can pose security threats:
We can try Netlify and see if it introduces any vulnerabilities. If yes, we can go with either Deploy PR Preview or preview-docs.espressif.com
suggested by @igrr
Another interesting approach:
https://stackoverflow.com/questions/70620223/deploying-hugo-onto-staging-website-from-feature-branch
Originally posted by @tore-espressif in https://github.com/espressif/developer-portal/issues/37#issuecomment-2189391818
As of now the only way to preview a new article in a PR is:
hugo server
.Automate the preview process by building the PR branch with Hugo and deploying it using GitHub Actions: