Skip to content

Commit e13bda8

Browse files
committed
update docs deployment
1 parent 906f847 commit e13bda8

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/docs.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
name: Deploy production docs
1+
name: Deploy docs
22

33
on:
44
pull_request:
55
types:
66
- closed
77
branches:
88
- "changeset-release/main"
9+
push:
10+
branches:
11+
- main
912

1013
jobs:
11-
deploy-production:
14+
deploy:
1215
runs-on: ubuntu-latest
13-
if: github.event.pull_request.merged == true
16+
if: |
17+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
18+
(github.event_name == 'push' && github.ref == 'refs/heads/main')
1419
1520
steps:
1621
- uses: actions/checkout@v4
@@ -20,8 +25,17 @@ jobs:
2025

2126
- name: Install Vercel CLI
2227
run: npm install --global vercel@latest
23-
- name: Deploy to Vercel
28+
29+
- name: Deploy to Production
30+
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
2431
run: vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
2532
env:
2633
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
2734
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
35+
36+
- name: Deploy to Preview
37+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
38+
run: vercel --token=${{ secrets.VERCEL_TOKEN }}
39+
env:
40+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
41+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

0 commit comments

Comments
 (0)