-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (27 loc) · 1.08 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Deploy to local server on Push
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cloudflared
run: |
sudo apt-get update
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb || sudo apt-get install -f -y
cloudflared --version
- name: Execute Remote Script via SSH
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
SSH_HOST: ${{ secrets.SSH_HOST }}
run: |
# Create SSH command with properly quoted options
SSH_COMMAND=sshpass -p $SSH_PASSWORD ssh -o ProxyCommand=cloudflared access ssh --hostname $SSH_HOST -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_HOST
# Execute the remote script directly on the remote server
$SSH_COMMAND 'bash ~/Documents/cosmere-feed-bsky/restart_script.sh'