-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (81 loc) · 2.7 KB
/
deploy.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: deploy
on:
workflow_dispatch:
push:
branches:
- master
env:
DB_TYPE: ${{ secrets.DB_TYPE }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
DB_RETRY_DELAY: ${{ secrets.DB_RETRY_DELAY }}
DB_RETRY_ATTEMPTS: ${{ secrets.DB_RETRY_ATTEMPTS }}
WRITE_SWAGGER: ${{ secrets.WRITE_SWAGGER }}
RUNNING_ENV: ${{ secrets.RUNNING_ENV }}
POSTGRES_URL: ${{ secrets.POSTGRES_URL }}
POSTGRES_PRISMA_URL: ${{ secrets.POSTGRES_PRISMA_URL }}
POSTGRES_URL_NON_POOLING: ${{ secrets.POSTGRES_URL_NON_POOLING }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DATABASE: ${{ secrets.POSTGRES_DATABASE }}
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🚀
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- name: Install pnpm 🚀
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
run_install: false
# - name: Cache pnpm dependencies 🚀
# uses: actions/cache@v2
# id: pnpm-cache
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-
- name: Install dependencies 🚀
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm update && pnpm install --no-frozen-lockfile
- name: Setup Node.js 🚀
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build project 🚀
env:
NODE_OPTIONS: --max_old_space_size=4096
run: pnpm run build
- name: Deploy to Vercel 🚀
run: npx vercel --token ${VERCEL_TOKEN} --prod
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# vercel-args: '--prod' #Optional
# github-token: ${{ secrets.GIT_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Deploy to nestjs.h7ml.cn 🚀
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GIT_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
github-comment: false
alias-domains: |
nestjs.h7ml.cn