-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (46 loc) · 1.66 KB
/
Copy pathdeploy.yml
File metadata and controls
59 lines (46 loc) · 1.66 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
name: "Build and deploy browser extension"
on:
workflow_call:
workflow_dispatch:
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VITE_CF_KEY: ${{ secrets.VITE_CF_KEY }}
NODE_VERSION: 18
jobs:
build-deploy-browser-extension:
name: Build and deploy browser extension
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
- name: create .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0
with:
version: latest
- name: Install dependencies (browser-extension)
run: pnpm install --frozen-lockfile
- name: Build extension (webapp)
run: pnpm build
- name: Pull vercel data
run: vercel pull --token=${{ secrets.VERCEL_TOKEN }}
- name: Build for vercel
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to vercel
run: |
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} > deployment-url.txt
echo "frontend preview deployment: <br />$(cat deployment-url.txt)" > deployment-url.txt