Skip to content

Commit 8a79257

Browse files
committed
ci: add vercel deploy pipeline
1 parent 1df6f98 commit 8a79257

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
name: Deploy Angular App to Vercel
15+
16+
defaults:
17+
run:
18+
working-directory: frontend # Set working directory to frontend folder
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '18'
28+
cache: 'npm'
29+
cache-dependency-path: frontend/package-lock.json
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build Angular app
35+
run: npm run build
36+
env:
37+
NODE_ENV: production
38+
39+
- name: Install Vercel CLI
40+
run: npm install --global vercel@latest
41+
42+
- name: Pull Vercel Environment Information
43+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
44+
45+
- name: Deploy to Vercel
46+
run: |
47+
if [ ${{ github.event_name }} = 'push' ]; then
48+
vercel deploy ./dist/chaospilot --prod --token=${{ secrets.VERCEL_TOKEN }}
49+
else
50+
vercel deploy ./dist/chaospilot --token=${{ secrets.VERCEL_TOKEN }}
51+
fi
52+
env:
53+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
54+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
55+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

0 commit comments

Comments
 (0)