-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 1.73 KB
/
Copy pathpreview.yml
File metadata and controls
63 lines (58 loc) · 1.73 KB
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
61
62
63
name: PR Preview
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
pull-requests: read
concurrency:
group: preview-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
revision:
if: ${{ github.event.pull_request.draft == false && github.event.pull_request.user.login != 'dependabot[bot]' }}
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
number: ${{ steps.revision.outputs.number }}
head: ${{ steps.revision.outputs.head }}
repository: ${{ steps.revision.outputs.repository }}
steps:
- uses: actions/checkout@v7
with:
ref: main
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: '24'
- run: npm ci --ignore-scripts
- id: revision
run: node scripts/preview-ci.ts
env:
GH_TOKEN: ${{ github.token }}
build:
needs: revision
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
repository: ${{ needs.revision.outputs.repository }}
ref: ${{ needs.revision.outputs.head }}
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: '24'
- run: npm ci
- run: npm run build -- --base ./
env:
VITE_HISTORY_URL: ./data/index.json
- uses: actions/upload-artifact@v7
with:
name: preview-${{ needs.revision.outputs.number }}-${{ needs.revision.outputs.head }}-${{ github.run_attempt }}
path: dist/
if-no-files-found: error
retention-days: 90