File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : CI/CD
1+ name : CI
22
33on :
44 push :
5- branches : [main, master]
5+ branches : [master]
66 pull_request :
7- branches : [main, master]
7+ branches : [master]
88
99jobs :
1010 build :
2828
2929 - name : Build
3030 run : npm run build
31-
32- # Vercel 部署(生产环境)
33- deploy-production :
34- runs-on : ubuntu-latest
35- needs : build
36- if : github.ref == 'refs/heads/main'
37-
38- steps :
39- - name : Checkout code
40- uses : actions/checkout@v4
41-
42- - name : Deploy to Vercel (Production)
43- uses : vercel/action-deploy@v1
44- with :
45- vercel-token : ${{ secrets.VERCEL_TOKEN }}
46- vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
47- vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
48- vercel-args : ' --prod'
49-
50- # Vercel 部署(预览环境)
51- deploy-preview :
52- runs-on : ubuntu-latest
53- needs : build
54- if : github.ref != 'refs/heads/main'
55-
56- steps :
57- - name : Checkout code
58- uses : actions/checkout@v4
59-
60- - name : Deploy to Vercel (Preview)
61- uses : vercel/action-deploy@v1
62- with :
63- vercel-token : ${{ secrets.VERCEL_TOKEN }}
64- vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
65- vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
You can’t perform that action at this time.
0 commit comments