Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 17, 2025

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)

  • Triggers automatically on every PR to the master branch
  • Creates preview builds with clear PR identification markers
  • Uploads builds as downloadable GitHub Actions artifacts
  • Posts helpful bot comments with download links and testing instructions

📚 Complete Documentation

  • Added comprehensive README.md with usage guide and project structure
  • Updated CLAUDE.md to reflect current deployment setup and design system
  • Added .gitignore to prevent build artifacts from being committed

How It Works

When a pull request is created or updated:

  1. Build: A preview version is created with PR indicators injected into the HTML
  2. Artifact: The preview is packaged and uploaded as a downloadable zip file
  3. Notification: An automated comment provides the download link and testing instructions

Contributors can then download the artifact, extract it, and open index.html locally to test changes before they go live.

Benefits

  • Safe Testing: Preview changes without affecting the live site
  • No External Dependencies: Uses GitHub's built-in Actions and artifact storage
  • Streamlined Deployment: Focused purely on deployment functionality without validation overhead
  • Clear Instructions: Bot comments guide users through the testing process
  • Clean Repository: Artifacts are temporary and don't clutter the codebase

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.

Copilot AI and others added 2 commits September 17, 2025 22:07
Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] no deployment out branches Implement automated PR preview deployment system Sep 17, 2025
@Copilot Copilot AI requested a review from Quist September 17, 2025 22:09
Copilot finished work on behalf of Quist September 17, 2025 22:09
Copy link
Owner

@Quist Quist left a 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.

with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Validate HTML
Copy link
Owner

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.

Copy link
Contributor Author

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

@Quist
Copy link
Owner

Quist commented Sep 18, 2025

Dropp valideringsdelen, @copilot

Co-authored-by: Quist <1188754+Quist@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 18, 2025

Dropp testedelen, vi ønsker å rendyrke dette som en deployjobb.

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

Copy link
Contributor Author

Copilot AI commented Sep 18, 2025

Dropp valideringsdelen, @copilot

Validation part completely removed. The workflow is now focused solely on deployment functionality. Commit: 5ff5c1a

@Quist Quist marked this pull request as ready for review September 18, 2025 06:50
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 06:50
@Copilot Copilot AI requested a review from Quist September 18, 2025 06:51
Copy link

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI Sep 18, 2025

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.

Suggested change
- 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
Copy link
Preview

Copilot AI Sep 18, 2025

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.

Suggested change
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
Copy link
Preview

Copilot AI Sep 18, 2025

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.

Suggested change
> 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.

Copy link
Owner

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

@Copilot Copilot AI requested a review from Quist September 18, 2025 21:21
Copilot finished work on behalf of Quist September 18, 2025 21:21
Copy link

🚀 PR Preview Deployed!

📦 Download Preview: Preview Build Artifact

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://Quist.github.io

🔄 This preview updates automatically with new commits.

Deployed: 2025-09-21T21:19:13.806Z

@Quist Quist merged commit 3d85f1c into master Sep 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no deployment out branches
2 participants