solve conflict #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |