-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (44 loc) · 1.2 KB
/
preview.yaml
File metadata and controls
48 lines (44 loc) · 1.2 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
# .github/workflows/preview.yml
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy-preview:
runs-on: ubuntu-latest
env:
EODASH_OPENCAGE: ${{ secrets.EODASH_OPENCAGE }}
permissions:
contents: write
pages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Build with VitePress with correct base
run: npm run build -- --base /pr-preview/pr-${{ github.event.number }}/
- name: Deploy preview to Github Pages
uses: rossjrw/pr-preview-action@v1 #v2 should be coming soon
with:
source-dir: .vitepress/dist