-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (56 loc) · 1.85 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
name: vercel deploy
on:
push:
branches:
- master
pull_request:
jobs:
vercel-deploy:
runs-on: ubuntu-latest
steps:
- name: global-setting
run: npm install -g [email protected]
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: yarn && yarn build
- name: set up pr preview
uses: amondnet/vercel-action@v25
id: vercel-action-staging
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./
- name: set up production
uses: amondnet/vercel-action@v25
id: vercel-action-production
if: github.event_name == 'push'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./
vercel-args: '--prod'
- name: upload to cdn
uses: wlixcc/[email protected]
if: github.event_name == 'push'
with:
username: ${{ secrets.SFTP_USERNAME }}
server: ${{ secrets.SFTP_SERVER }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: './cloudtower-api-doc/build/*'
remote_path: '/uploads/code-site'
sftp_only: true