Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
richardr1126 authored Dec 18, 2024
1 parent 7fcac23 commit 3404495
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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
sudo apt-get install -y cloudflared
- 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 ProxyCommand
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
$SSH_COMMAND 'bash -s' < ~/Documents/cosmere-feed-bsky/restart_script.sh

0 comments on commit 3404495

Please sign in to comment.