Skip to content

Create unstoppable-deployment.yaml #14

Create unstoppable-deployment.yaml

Create unstoppable-deployment.yaml #14

Workflow file for this run

name: DeployUnstoppable on EC2
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: SSH into EC2-1 instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/unstoppable/
git stash
git pull
npm ci
npm run build
sudo systemctl restart unstoppable.service
- name: SSH into EC2-2 instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST_2 }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/unstoppable/
git stash
git pull
npm ci
npm run build
sudo systemctl restart unstoppable.service