-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1016 Bytes
/
action.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
name: Build and Push Docker Image
on:
push:
branches: [ main ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: jerneithe/category_service
- name: ec2 접속 및 애플리케이션 실행
uses : appleboy/ssh-action@v0.1.6
with :
host : ${{ secrets.EC2_HOST }}
username : ubuntu
key : ${{ secrets.EC2_PEMKEY }}
port : 22
script : |
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker pull jerneithe/comment_service