fix the GitHub action files that lead to conflicts#78
Merged
Conversation
* Update pr-preview.yml
* Isolate PR previews to prevent overwriting production site
The previous pull request preview workflow deployed directly to the
GitHub Pages environment, completely overwriting the existing site
content. This meant that generating a PR preview would take down the live
production site.
This commit modifies the preview workflow to make it non-destructive:
- The workflow now first checks out the `main` branch and builds the full
production site into the `/public` directory.
- It then checks out the pull request's head branch and builds the
specific PR preview into a subdirectory (e.g., `/public/pr-123`).
- The combined result is then deployed, ensuring that the production site
and the PR preview can coexist.
The previous pull request preview workflow deployed directly to the GitHub Pages environment, completely overwriting the existing site content. This meant that generating a PR preview would take down the live production site. This commit modifies the preview workflow to make it non-destructive: - The workflow now first checks out the `main` branch and builds the full production site into the `/public` directory. - It then checks out the pull request's head branch and builds the specific PR preview into a subdirectory (e.g., `/public/pr-123`). - The combined result is then deployed, ensuring that the production site and the PR preview can coexist. This change prevents conflicts between the preview and production deployment pipelines.
The Hugo build was creating the 'public' directory inside the checkout subdirectories instead of the workspace root. This caused the artifact upload step to fail. This commit corrects the '--destination' flag for both Hugo build commands to use an absolute path, ensuring the build output is placed in the correct location.
|
Preview deployed at: https://yqtian.com/acmsigsoft.github.io/pr-78 |
CaptainEmerson
approved these changes
Aug 24, 2025
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.
The previous pull request preview workflow deployed directly to the
GitHub Pages environment, completely overwriting the existing site
content. This meant that generating a PR preview would take down the live
production site.
This commit modifies the preview workflow to make it non-destructive:
mainbranch and builds the fullproduction site into the
/publicdirectory.specific PR preview into a subdirectory (e.g.,
/public/pr-123).and the PR preview can coexist.