v0.2.0-final #10
Workflow file for this run
This file contains hidden or 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 to EC2 | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install SSH Key | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | |
# stop old service and start a new one | |
- name: Deploy to EC2 | |
run: | | |
ssh -o StrictHostKeyChecking=no adamma2048@${{ secrets.EC2_IP }} << EOF | |
cd seprojects-cs673a2f24_team5 | |
sudo bash docker_auto_start.sh stop | |
git switch main | |
git pull | |
sudo bash docker_auto_start.sh start | |
EOF |