Skip to content

Commit 41727dd

Browse files
johanvorick-nu
andauthored
Add default Vercel deploy actions (#5)
* Add default Vercel deploy actions * Add manual npm run build step * Add manual npm install * Add manual npm config set legacy-peer-deps true * Set npm config value that allows beta deps * use production branch instead of main --------- Co-authored-by: Rick van der Staaij <[email protected]>
1 parent e6df450 commit 41727dd

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/preview.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Vercel Preview Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
push:
7+
branches-ignore:
8+
- production
9+
jobs:
10+
Deploy-Preview:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install Vercel CLI
15+
run: npm install --global vercel@latest
16+
- name: Pull Vercel Environment Information
17+
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
18+
- name: Allow install of beta dependencies
19+
run: npm config set legacy-peer-deps true
20+
- name: Build Project Artifacts
21+
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
22+
- name: Deploy Project Artifacts to Vercel
23+
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
24+

.github/workflows/production.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Vercel Production Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
push:
7+
branches:
8+
- production
9+
jobs:
10+
Deploy-Production:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install Vercel CLI
15+
run: npm install --global vercel@latest
16+
- name: Pull Vercel Environment Information
17+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
18+
- name: Allow install of beta dependencies
19+
run: npm config set legacy-peer-deps true
20+
- name: Build Project Artifacts
21+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
22+
- name: Deploy Project Artifacts to Vercel
23+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)