Skip to content

Commit daafe08

Browse files
committed
feat: added ci
1 parent 2d73ef5 commit daafe08

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Telegram Bot to EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
name: Deploy to EC2
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup SSH key
18+
run: |
19+
mkdir -p ~/.ssh
20+
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
21+
chmod 600 ~/.ssh/id_rsa
22+
ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
23+
24+
- name: Deploy to EC2
25+
run: |
26+
ssh ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF'
27+
sudo sh bot-installer.sh
28+
EOF

0 commit comments

Comments
 (0)