-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.06 KB
/
docker-image.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
name: Docker Image CI
on:
pull_request:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: build and release to DockerHub
env:
NAME: yeobi # 계정 명
REPO: morandi-frontend # 레포 이름
run: |
docker build -t $REPO .
docker tag $REPO:latest $NAME/$REPO:latest
docker push $NAME/$REPO:latest
- name: SSH into AWS EC2 instance
uses: appleboy/ssh-action@master
with:
host: 10.0.128.33
username: ubuntu
key: ${{ secrets.AWS_SSH_PRIVATE_KEY }}
proxy_host: 3.35.14.92
proxy_username: ubuntu
proxy_key: ${{ secrets.AWS_SSH_PRIVATE_KEY }}
# 아래 내용을 실행하여 Docker 이미지를 내려받고 실행
script: |
./deploy-frontend.sh