Skip to content

Merge pull request #7 from 2025-Graduation-Design/new #4

Merge pull request #7 from 2025-Graduation-Design/new

Merge pull request #7 from 2025-Graduation-Design/new #4

Workflow file for this run

name: Deploy to EC2 on develop push
on:
push:
branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Add SSH Key
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Add EC2 Host to known_hosts
run: ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
- name: Run deploy.sh on EC2
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "bash /home/ubuntu/deploy.sh"