-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 1.02 KB
/
react.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
name: Deploy React
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: react docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_REPO }}/eum-react:latest .
docker push ${{ secrets.DOCKER_REPO }}/eum-react:latest
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ubuntu
key: ${{ secrets.AWS_KEY }}
script: |
if [ "$(sudo docker ps -qa)" ]; then
sudo docker rm -f $(sudo docker ps -qa)
fi
sudo docker pull ${{ secrets.DOCKER_REPO }}/eum-react:latest
sudo docker-compose -f alpha-e_um-deploy/docker-compose.yml up -d
sudo docker image prune -f