forked from EddieHubCommunity/BioDrop
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.41 KB
/
vercel-pr-preview.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
name: Deploy PR to Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
workflow_dispatch:
pull_request:
branches-ignore:
- revert-logger
paths:
- "**.js"
jobs:
deploy:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.deploy-preview.outputs.url }}
steps:
- uses: actions/checkout@v3
- name: install Vercel CLI
run: npm install --global vercel@latest
- name: pull Vercel environment information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: build project artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: deploy preview
id: deploy-preview
run: |
du --inodes -d 5 .vercel/output
ls -l .vercel/output/functions
preview_url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
echo "url=$preview_url" >> $GITHUB_OUTPUT
echo "deployed to $preview_url"
load-data:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: load json files
run: curl -L -f ${{ needs.deploy.outputs.url }}/api/system/reload?secret=${{ secrets.BIODROP_API_SECRET_PREVIEW }}
- name: load testimonial files
run: curl -L -f ${{ needs.deploy.outputs.url }}/api/system/testimonials-forms?secret=${{ secrets.BIODROP_API_SECRET_PREVIEW }}