PRs: Add preview workflow using GitHub Actions - #908
Draft
Venefilyn wants to merge 1 commit into
Draft
Conversation
Adds a PR preview workflows that - Create a build from PR itself without secrets - Publishes build artifact to preview PR subdirectory in gh-pages branch - Removes preview PR subdirectory from gh-pages branch Reason for a split between build and publish has to do with a workaround for security where workflows that are triggered on a pull request cannot access secrets. As the deploy workflow just publishes an artifact it can have access to secrets. Note this only has to do with PRs from forks and does not matter for PRs within the repo itself. PR deployment and PR teardowns are run from the base repository and is therefore secure. Build workflows will need to be manually approved from outside contributors. They will only be deployed if build workflow has succeeded. Upon PR preview being created a comment will be added to the PR itself with a link to the preview URL. If this PR is run against our main we will publish the preview under <cockpit-project.org/preview-pr/> and if the PR is run against a fork it will publish the preview under <username.github.io/cockpit-project.github.io/preview-pr/>. If the user has a custom domain for their <username.github.io> the links will still work but just be redirected by GitHub. Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Member
Author
|
@allisonkarlitskaya Here it is. This likely breaks deployment currently. I think we'd have to get rid of the GitHub build and deploy workflow altogether cause I'm running into this issue. If merged this would break URLs completely in its current state The thing with the GitHub workflow is also that it is extremely outdated, we're talking years old with no update on the workflow as well as a lot of the plugins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a PR preview workflows that
Reason for a split between build and publish has to do with a workaround
for security where workflows that are triggered on a pull request cannot
access secrets. As the deploy workflow just publishes an artifact it can
have access to secrets. Note this only has to do with PRs from forks and
does not matter for PRs within the repo itself.
PR deployment and PR teardowns are run from the base repository and is
therefore secure.
Build workflows will need to be manually approved from outside
contributors. They will only be deployed if build workflow has
succeeded.
Upon PR preview being created a comment will be added to the PR itself
with a link to the preview URL. If this PR is run against our main we
will publish the preview under <cockpit-project.org/preview-pr/> and if
the PR is run against a fork it will publish the preview under
<username.github.io/cockpit-project.github.io/preview-pr/>. If the user
has a custom domain for their <username.github.io> the links will still
work but just be redirected by GitHub.