-
Notifications
You must be signed in to change notification settings - Fork 0
Implement automated PR preview deployment system #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropp testedelen, vi ønsker å rendyrke dette som en deployjobb.
.github/workflows/pr-validation.yml
Outdated
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Validate HTML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropp all validering i denne pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All validation removed from the workflow. Now it's a clean deployment-only process that builds and uploads PR previews. Commit: 5ff5c1a
Dropp valideringsdelen, @copilot |
Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
Removed all validation steps and streamlined the workflow to be a pure deployment job as requested. The workflow now only handles building and deploying PR previews without any testing/validation components. Commit: 5ff5c1a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implementering av automatisert PR forhåndsvisningssystem for porteføljenettstedet. Systemet oppretter nedlastbare forhåndsvisninger av endringer i pull requests uten validering, fokusert på ren deployment-funksjonalitet.
- Opprettet GitHub Actions workflow for automatisk PR-deployment
- Lagt til omfattende dokumentasjon i README.md
- Oppdatert CLAUDE.md med gjeldende deployment-informasjon
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
README.md | Ny omfattende dokumentasjon for prosjektet med PR forhåndsvisningssystem |
CLAUDE.md | Oppdaterte deployment-instruksjoner og designsystem-detaljer |
.github/workflows/pr-validation.yml | Ny GitHub Actions workflow for PR forhåndsvisnings-deployment |
CLAUDE.md
Outdated
**Production:** The site is hosted via GitHub Pages (quist.github.io). Changes pushed to the master branch are automatically deployed. | ||
|
||
**PR Previews:** Pull requests automatically trigger a preview build workflow: | ||
- HTML/CSS validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dokumentasjonen nevner 'HTML/CSS validation' men ifølge PR-beskrivelsen ble alle valideringstrinn fjernet fra workflowen. Denne linjen bør fjernes for å reflektere den faktiske funksjonaliteten.
- HTML/CSS validation |
Copilot uses AI. Check for mistakes.
cp styles.css preview-build/ | ||
# Add a preview indicator to the build | ||
sed -i '/<title>/a\<!-- PR Preview Build #${{ github.event.pull_request.number }} -->' preview-build/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sed-kommandoen kan feile hvis <title>
-taggen ikke finnes eller har uventet formatering. Dette kan føre til at workflow feiler. Vurder å bruke en mer robust tilnærming eller legg til feilhåndtering.
sed -i '/<title>/a\<!-- PR Preview Build #${{ github.event.pull_request.number }} -->' preview-build/index.html | |
if grep -qi '<title>' preview-build/index.html; then | |
sed -i '/<title>/I a <!-- PR Preview Build #${{ github.event.pull_request.number }} -->' preview-build/index.html | |
else | |
echo "Warning: <title> tag not found in preview-build/index.html. Skipping preview indicator insertion." | |
fi |
Copilot uses AI. Check for mistakes.
> **How to test this PR:** | ||
> 1. Click the artifact link above and download the preview | ||
> 2. Extract the ZIP file and open \`index.html\` in your browser | ||
> 3. Compare with live site: https://${{ github.repository_owner }}.github.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL-en bruker github.repository_owner
som kan gi feil adresse. Basert på konteksten bør dette være den spesifikke GitHub Pages URL-en https://quist.github.io
for å sikre korrekt sammenligning.
> 3. Compare with live site: https://${{ github.repository_owner }}.github.io | |
> 3. Compare with live site: https://quist.github.io |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase on main, please @copilot
🚀 PR Preview Deployed! 📦 Download Preview: Preview Build Artifact
🔄 This preview updates automatically with new commits. Deployed: 2025-09-21T21:19:13.806Z |
This PR adds a streamlined GitHub Actions workflow to automatically deploy pull request branches for testing, addressing the need to preview changes before merging to production.
What's New
🚀 Automated PR Preview Workflow (
.github/workflows/pr-validation.yml
)📚 Complete Documentation
README.md
with usage guide and project structureCLAUDE.md
to reflect current deployment setup and design system.gitignore
to prevent build artifacts from being committedHow It Works
When a pull request is created or updated:
Contributors can then download the artifact, extract it, and open
index.html
locally to test changes before they go live.Benefits
This solution provides a clean, maintainable way to deploy PR changes for testing using only GitHub's native infrastructure, with no external hosting services or API keys required.
Fixes #4.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.