-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (27 loc) · 1.03 KB
/
frontend-prod.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
name: "[Frontend] production CI/CD"
on:
push:
branches: ["main"]
paths:
- "client/**"
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- name: Docker Build - Production
run: |
docker login -u ${{ secrets.FRONTEND_DOCKERHUB_USERNAME }} -p ${{ secrets.FRONTEND_DOCKERHUB_PASSWORD }}
docker build -t zokboo-front-prod --build-arg SERVER_URL=${{ secrets.SERVER_URL }} ./client/
docker image tag zokboo-front-prod heroleggo/zokboo-front-prod:blue
docker image tag zokboo-front-prod heroleggo/zokboo-front-prod:green
docker image push -a heroleggo/zokboo-front-prod
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_SERVER_IP }}
port: ${{ secrets.PROD_SERVER_PORT }}
username: ${{ secrets.PROD_SERVER_USERNAME }}
password: ${{ secrets.PROD_SERVER_PASSWORD }}
script: /build/frontend/deploy-blue-green.sh