Skip to content

Commit

Permalink
Merge pull request #28 from Kim-s-pirate/feat-github-action
Browse files Browse the repository at this point in the history
feat:Github Action
  • Loading branch information
rocknroll17 authored Nov 5, 2024
2 parents 238c13a + c1eb0a9 commit 805bfc8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/CI_CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Auto deploy to EC2

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up SSH
run: |
echo "${{ secrets.EC2_SSH_KEY }}" > private_key
chmod 600 private_key
- name: Deploy to EC2
run: |
ssh -i private_key -o StrictHostKeyChecking=no [email protected] 'sudo lsof -t -i :1500 | xargs sudo kill -9 && cd ~/planner_server && git pull && screen -S server -X stuff "cd ~/planner_server\n" && screen -S server -X stuff "python3 main.py\n"'

0 comments on commit 805bfc8

Please sign in to comment.