Skip to content

Merge pull request #30 from StartaleLabs/update-job-link #21

Merge pull request #30 from StartaleLabs/update-job-link

Merge pull request #30 from StartaleLabs/update-job-link #21

Workflow file for this run

name: Deploy 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 ~/startale/startale-website/
git stash &&
git pull &&
npm ci &&
npm run build &&
sudo systemctl restart startale.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 ~/startale/startale-website/
git stash &&
git pull &&
npm ci &&
npm run build &&
sudo systemctl restart startale.service