@@ -87,49 +87,41 @@ jobs:
87
87
statuses : write
88
88
outputs :
89
89
deployment-url : ${{ steps.deploy.outputs.deployment-url }}
90
- env :
91
- VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
92
- VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
93
90
steps :
94
91
- name : Checkout
95
92
uses : actions/checkout@v4
96
- - name : Setup Bun
97
- uses : ./.github/composite/setup-bun
98
- - name : Install dependencies
99
- run : bun install --frozen-lockfile
100
- env :
101
- PUPPETEER_SKIP_DOWNLOAD : 1
102
- - name : Sets env vars for production
103
- run : |
104
- echo "VERCEL_ENVIRONMENT=production" >> $GITHUB_ENV
105
- echo "SENTRY_ENVIRONMENT=production" >> $GITHUB_ENV
106
- echo "GITBOOK_URL=https://open-2v.gitbook.com" >> $GITHUB_ENV
107
- echo "GITBOOK_ASSETS_PREFIX=https://static-2v.gitbook.com" >> $GITHUB_ENV
108
- if : startsWith(github.ref, 'refs/heads/main')
109
- - name : Sets env vars for preview
110
- run : |
111
- echo "VERCEL_ENVIRONMENT=preview" >> $GITHUB_ENV
112
- echo "SENTRY_ENVIRONMENT=preview" >> $GITHUB_ENV
113
- if : 1 && !startsWith(github.ref, 'refs/heads/main')
114
- - name : Pull Vercel Environment Information
115
- run : bun run vercel pull --yes --environment=$VERCEL_ENVIRONMENT --token=${{ secrets.VERCEL_TOKEN }}
116
- - name : Build Project Artifacts
117
- run : bun run vercel build --target=$VERCEL_ENVIRONMENT --token=${{ secrets.VERCEL_TOKEN }}
118
- env :
119
- SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
120
- NEXT_SERVER_ACTIONS_ENCRYPTION_KEY : ${{ secrets.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY }}
121
- SENTRY_ORG : ${{ vars.SENTRY_ORG }}
122
- SENTRY_PROJECT : ${{ vars.SENTRY_PROJECT }}
123
- SENTRY_DSN : ${{ vars.SENTRY_DSN }}
124
- SENTRY_RELEASE : ${{ github.sha }}
125
- - name : Deploy Project Artifacts to Vercel
93
+ - name : Deploy ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }}
126
94
id : deploy
127
- run : |
128
- DEPLOYMENT_URL=$(bun run vercel deploy --prebuilt --target=$VERCEL_ENVIRONMENT --token=${{ secrets.VERCEL_TOKEN }})
129
- echo "deployment-url=$DEPLOYMENT_URL" >> "$GITHUB_OUTPUT"
130
- - name : Outputs
131
- run : |
132
- echo "URL: ${{ steps.deploy.outputs.deployment-url }}"
95
+ uses : ./.github/composite/deploy-vercel
96
+ with :
97
+ environment : ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }}
98
+ vercel-org : ${{ secrets.VERCEL_ORG_ID }}
99
+ vercel-project : ${{ secrets.VERCEL_PROJECT_ID }}
100
+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
101
+ deploy-v2-vercel-staging :
102
+ name : Deploy v2 to Vercel (staging)
103
+ runs-on : ubuntu-latest
104
+ permissions :
105
+ contents : read
106
+ deployments : write
107
+ issues : write
108
+ pull-requests : write
109
+ checks : write
110
+ statuses : write
111
+ if : startsWith(github.ref, 'refs/heads/main')
112
+ outputs :
113
+ deployment-url : ${{ steps.deploy.outputs.deployment-url }}
114
+ steps :
115
+ - name : Checkout
116
+ uses : actions/checkout@v4
117
+ - name : Deploy staging
118
+ id : deploy
119
+ uses : ./.github/composite/deploy-vercel
120
+ with :
121
+ environment : staging
122
+ vercel-org : ${{ secrets.VERCEL_ORG_ID }}
123
+ vercel-project : ${{ secrets.VERCEL_PROJECT_ID }}
124
+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
133
125
deploy-v2-cloudflare :
134
126
name : Deploy v2 to Cloudflare Worker
135
127
runs-on : ubuntu-latest
@@ -142,9 +134,6 @@ jobs:
142
134
statuses : write
143
135
outputs :
144
136
deployment-url : ${{ steps.deploy.outputs.deployment-url }}
145
- env :
146
- VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
147
- VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
148
137
steps :
149
138
- name : Checkout
150
139
uses : actions/checkout@v4
0 commit comments