-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.7 KB
/
deploy.yml
File metadata and controls
61 lines (50 loc) · 1.7 KB
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
name: Deploy
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: vercel-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# sync-docs.mjs pulls the SDK + spec docs from GitHub instead of sibling repos.
SDK_DOCS_REMOTE: '1'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install Vercel CLI
run: pnpm add --global vercel@latest
- name: Resolve deploy target
id: target
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "prod=--prod" >> "$GITHUB_OUTPUT"
echo "env=production" >> "$GITHUB_OUTPUT"
else
echo "prod=" >> "$GITHUB_OUTPUT"
echo "env=preview" >> "$GITHUB_OUTPUT"
fi
- name: Pull Vercel environment
run: vercel pull --yes --environment=${{ steps.target.outputs.env }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Build with Vercel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
run: vercel build ${{ steps.target.outputs.prod }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
run: vercel deploy --prebuilt ${{ steps.target.outputs.prod }} --token=${{ secrets.VERCEL_TOKEN }}