Skip to content

Commit 6b46b89

Browse files
committed
chore: deploy yml 추가
1 parent 0337854 commit 6b46b89

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Deploy
2+
3+
env:
4+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
5+
6+
on:
7+
pull_request:
8+
types:
9+
- closed
10+
branches:
11+
- develop
12+
13+
jobs:
14+
project-build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
24+
cache: "yarn"
25+
26+
- name: Set yarn version
27+
id: set-version
28+
run: |
29+
yarn set version 4.1.1
30+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
31+
32+
- name: Yarn cache - PnP
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
.yarn/cache
37+
.pnp.*
38+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
39+
restore-keys: |
40+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
41+
42+
- name: Install dependencies
43+
run: yarn
44+
45+
- name: Run build
46+
run: yarn build
47+
48+
deploy-to-vercel:
49+
runs-on: ubuntu-latest
50+
needs: project-build
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup node
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: 18
59+
cache: "yarn"
60+
61+
- name: Set yarn version
62+
id: set-version
63+
run: |
64+
yarn set version 4.1.1
65+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
66+
67+
- name: Yarn cache - PnP
68+
uses: actions/cache@v4
69+
with:
70+
path: |
71+
.yarn/cache
72+
.pnp.*
73+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
74+
restore-keys: |
75+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
76+
77+
- name: Install dependencies
78+
run: yarn
79+
80+
- name: Deploy to Vercel
81+
run: |
82+
npm install --global vercel@latest
83+
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
84+
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
85+
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)