Skip to content

Commit f39967b

Browse files
committed
added the github action workflow for auto deployment
1 parent df9bee3 commit f39967b

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

.github/job.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# run this script locally only from root
55
# bash .github/job.sh
66

7-
echo "MONGODB_URI=mongodb+srv://techous:[email protected]/myFirstDatabase?retryWrites=true&w=majority" > .env
8-
echo "RATE_LIMIT_MINUTES=1" >> .env
9-
echo "RATE_LIMIT_MAX_REQUEST=10" >> .env
10-
echo "CACHE_STORAGE_SECONDS=30" >> .env
7+
# echo "MONGODB_URI=mongodb+srv://techous:[email protected]/myFirstDatabase?retryWrites=true&w=majority" > .env
8+
# echo "RATE_LIMIT_MINUTES=1" >> .env
9+
# echo "RATE_LIMIT_MAX_REQUEST=10" >> .env
10+
# echo "CACHE_STORAGE_SECONDS=30" >> .env
1111

1212
git clone "https://github.com/TechOUs/HacktoberFest21Community.git"
1313

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Vercel Deployment
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: '14.x'
17+
- run: yarn install
18+
- run: yarn run test
19+
env:
20+
MONGODB_URI: ${{ secrets.MONGODB_URI }}
21+
RATE_LIMIT_MINUTES: ${{ secrets.RATE_LIMIT_MINUTES }}
22+
RATE_LIMIT_MAX_REQUEST: ${{ secrets.RATE_LIMIT_MAX_REQUEST }}
23+
CACHE_STORAGE_SECONDS: ${{ secrets.CACHE_STORAGE_SECONDS }}
24+
deploy:
25+
needs: test
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: amondnet/vercel-action@v20
30+
with:
31+
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
32+
vercel-args: '--prod' #Optional
33+
vercel-org-id: ${{ secrets.ORG_ID}} #Required
34+
vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
35+
working-directory: .

.github/workflows/codebase-engine.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ jobs:
1111
with:
1212
node-version: '14.x'
1313
- run: npm install
14-
- run: bash .github/job.sh
14+
- run: bash .github/job.sh
15+
env:
16+
MONGODB_URI: ${{ secrets.MONGODB_URI }}
17+
RATE_LIMIT_MINUTES: ${{ secrets.RATE_LIMIT_MINUTES }}
18+
RATE_LIMIT_MAX_REQUEST: ${{ secrets.RATE_LIMIT_MAX_REQUEST }}
19+
CACHE_STORAGE_SECONDS: ${{ secrets.CACHE_STORAGE_SECONDS }}

vercel.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"version": 2,
3+
"github": {
4+
"enabled": false
5+
},
36
"builds":[
47
{
58
"src": "./bin/www",

0 commit comments

Comments
 (0)