Skip to content

Commit 811bf1b

Browse files
Copilotcommjoen
andcommitted
Update documentation for GitHub Pages PR preview feature
Co-authored-by: commjoen <[email protected]>
1 parent 13f85eb commit 811bf1b

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

docs/PR_PREVIEW_SETUP.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,52 @@ This document explains how to set up preview deployments for pull requests in th
44

55
## Available Preview Methods
66

7-
### 1. Full Preview Deployment (Recommended)
7+
### 1. GitHub Pages Static Preview (NEW)
8+
- **File**: `.github/workflows/github-pages-preview.yml`
9+
- **What it does**: Creates static HTML previews on GitHub Pages for each PR
10+
- **Requirements**: GitHub Pages enabled for the repository
11+
- **Benefits**: Fast, lightweight previews of UI changes, automatic cleanup, no external dependencies
12+
- **URL Format**: `https://owasp.github.io/wrongsecrets/pr-{number}/`
13+
14+
### 2. Full Preview Deployment (Recommended for testing)
815
- **File**: `.github/workflows/pr-preview.yml`
916
- **What it does**: Deploys each PR to a temporary environment
1017
- **Requirements**: Render.com account and API key
1118
- **Benefits**: Full functional testing, shareable links
1219

13-
### 2. Build-Only Preview
20+
### 3. Build-Only Preview
1421
- **File**: `.github/workflows/build-preview.yml`
1522
- **What it does**: Builds Docker image, provides local testing instructions
1623
- **Requirements**: None (uses GitHub Actions only)
1724
- **Benefits**: No external dependencies, quick setup
1825

19-
### 3. Visual Diff
26+
### 4. Visual Diff
2027
- **File**: `.github/workflows/visual-diff.yml`
2128
- **What it does**: Takes screenshots comparing PR vs main branch
2229
- **Requirements**: None (uses GitHub Actions only)
2330
- **Benefits**: Visual comparison of UI changes
2431

2532
## Setup Instructions
2633

34+
### For GitHub Pages Static Preview
35+
36+
1. **Enable GitHub Pages** in repository settings:
37+
- Go to repository Settings > Pages
38+
- Source: GitHub Actions
39+
- No additional configuration needed
40+
41+
2. **The workflow is automatic**: Once the workflow file is present, it will:
42+
- Trigger on PRs affecting templates, static files, or Java code
43+
- Generate static preview with all CSS, JS, and assets
44+
- Deploy to GitHub Pages with PR-specific URL
45+
- Clean up automatically when PR is closed
46+
47+
3. **What gets previewed**:
48+
- All static assets (CSS, JavaScript, images)
49+
- Basic HTML structure and styling
50+
- Theme toggle and UI components
51+
- Links to full Docker preview for functionality testing
52+
2753
### For Full Preview Deployment
2854

2955
1. **Create Render.com account** (free tier available)

0 commit comments

Comments
 (0)