-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.55 KB
/
develop-deploy-v1.yml
File metadata and controls
46 lines (43 loc) · 1.55 KB
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
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
# 리포지토리 체크아웃
- name: Checkout repository
uses: actions/checkout@v4
# Docker Hub 로그인
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# Docker 이미지 빌드 및 태깅
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: yong7317/o2o-fe:latest
build-args: |
NEXT_PUBLIC_API_MOCKING=${{ secrets.NEXT_PUBLIC_API_MOCKING }}
NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_KAKAO_APP_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_APP_KEY }}
NEXT_PUBLIC_PAY200_KEY=${{ secrets.NEXT_PUBLIC_PAY200_KEY }}
NEXT_PUBLIC_TOSS_PAY_KEY=${{ secrets.NEXT_PUBLIC_TOSS_PAY_KEY }}
NEXT_PUBLIC_KAKAO_API_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }}
# EC2 도커 컴포즈 실행
- name: SSH and Deploy
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd frontend
docker stop o2o-fe || true
docker rm o2o-fe || true
docker rmi yong7317/o2o-fe:latest || true
docker pull yong7317/o2o-fe:latest
docker-compose up -d