This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.57 KB
/
pr-visualizer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: pr-visualizer
on:
pull_request:
permissions:
pull-requests: write
contents: read
pages: write
id-token: write
jobs:
visualizer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install and Build
run: |
npm install
npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist/visualizer/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deployment
with:
branch: ${{ github.head_ref }}
- name: Find existing comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: '# Visualizer Report'
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id == '0'
with:
issue-number: ${{ github.event.number }}
body: |
# Visualizer Report
You can view the results [here](${{ steps.deployment.outputs.page_url }}).
- name: Update comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id != '0'
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
# Visualizer Report
You can view the results [here](${{ steps.deployment.outputs.page_url }}).
edit-mode: replace