Update deploy.yml #12
This file contains 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 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: | | |
which cloudflared | |
sshpass -p "$SSH_PASSWORD" ssh \ | |
-o 'ProxyCommand=/usr/local/bin/cloudflared access ssh --hostname %h' \ | |
-o StrictHostKeyChecking=no \ | |
"$SSH_USERNAME@$SSH_HOST" 'bash ~/Documents/cosmere-feed-bsky/restart_script.sh' |