-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (49 loc) · 1.58 KB
/
deploy_server.js.yml
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
name: Github Action For Frontend
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
strategy:
matrix:
node-version:
- 14.x
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ${{ github.workspace }}/package-lock.json
- run: npm install
- name: Build Docker Image
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
run: |
docker build \
-t remi_frontend \
.
docker tag remi_frontend:latest nguyenvanhuan243/remi_frontend:latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker Image
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
docker push nguyenvanhuan243/remi_frontend:latest
- name: Deploy to Render Server (Master)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
curl -X GET https://api.render.com/deploy/srv-co56ptkf7o1s739ab000?key=FBM5n-MMv5M
curl -X GET https://api.render.com/deploy/srv-co6f480l6cac73a7uii0?key=KFJgS6f3WC0