Skip to content

Commit d816110

Browse files
committed
ci: add pipeline to review PRs
1 parent 616a6ae commit d816110

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pull Request Pipeline
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
build-and-test:
9+
name: Build, Test, and Generate Unique Artifact
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 22
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run tests
25+
run: npm test
26+
27+
- name: Build the project
28+
run: npm run build
29+
30+
- name: Upload build artifact
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: site-preview-pr-${{ github.event.pull_request.number }}
34+
path: ./build

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ $ npm run build
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

27+
### Reviewing Pull Requests
28+
29+
This project uses GitHub Actions to automate building, testing, and generating a preview for pull requests. Here's how you can review pull requests effectively:
30+
31+
1. **Open the Pull Request**:
32+
- Navigate to the **Pull Requests** tab in the repository.
33+
- Select the PR you want to review.
34+
35+
2. **Access the Build Artifact**:
36+
- Go to the **Actions** tab in the repository.
37+
- Find the workflow run associated with the pull request (usually named `Pull Request Pipeline`).
38+
- Scroll down to the **Artifacts** section and download the artifact named `site-preview-pr-<PR_NUMBER>` (e.g., `site-preview-pr-123`).
39+
40+
3. **Preview the Changes**:
41+
- Extract the downloaded artifact.
42+
- Serve the files locally using a simple HTTP server. For example:
43+
```bash
44+
npx http-server <extracted-folder-path> -p 8080
45+
```
46+
- Open `http://localhost:8080` in your browser to review the changes.
47+
48+
4. **Provide Feedback**:
49+
- Leave comments or suggestions directly in the pull request under the **Files changed** tab.
50+
51+
2752
### Deployment
2853

2954
There is a [pipeline](.github/workflows/deploy.yml) that will deploy anytime that a new commit lands to `main` branch.

0 commit comments

Comments
 (0)