Skip to content

Commit 3ac25f2

Browse files
committed
feat: trigger deploy on release
1 parent 721a909 commit 3ac25f2

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Deploy"
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
jobs:
13+
vercel:
14+
runs-on: ubuntu-latest
15+
name: "Deploy Front-End"
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: "14"
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: "Deploy to Vercel"
25+
run: |
26+
prodRun=""
27+
if [[ ${GITHUB_REF} == "refs/heads/main" ]]; then
28+
prodRun="--prod"
29+
fi
30+
31+
npx vercel --token ${VERCEL_TOKEN} $prodRun
32+
env:
33+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
34+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
35+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
.env
66
package-lock.json
77
/client/package-lock.json
8-
yarn.lock
8+
yarn.lock
9+
.vercel

src/config/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const config = {
33
};
44

55
if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
6-
config.BASE_URL = 'https://stackoverflow-clone-backend.herokuapp.com';
6+
config.BASE_URL = 'http://localhost:5000';
77
}
88

99
export default config;

vercel.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"github": {
3+
"enabled": false,
4+
"silent": true
5+
}
6+
}

0 commit comments

Comments
 (0)