-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.67 KB
/
vercel-deploy.yaml
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
name: Vercel Deploy
on:
push:
branches: [dev, main]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
node-version: [16.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set-up Environment
run: |
if [ '${{ github.ref }}' == 'refs/heads/dev' ]
then
cp .env.development .env
else
cp .env.production .env
fi
rm .env.development .env.production
echo "NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}" >> .env
- name: Deploy to Development
uses: amondnet/vercel-action@v25
if: github.ref == 'refs/heads/dev'
id: deploy-vercel-development
with:
github-comment: false
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
alias-domains: dev-demo-by-tuder.vercel.app
- name: Deploy to Production
uses: amondnet/vercel-action@v25
if: github.ref == 'refs/heads/main'
id: deploy-vercel-production
with:
github-comment: false
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-args: '--prod'