Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
added ssh
  • Loading branch information
TJ2005 authored Oct 20, 2024
1 parent 4670bd2 commit 9d05281
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ name: Pull on GitHub Repo Update
on:
push:
branches:
- public # Adjust this to the branch you want to track
- public # Triggers on push to the 'public' branch

jobs:
pull_repo:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Pull latest changes
run: |
git pull public public # Replace 'main' with your branch name
- name: Deploy to Server via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }} # Your server's IP address or hostname
username: ${{ secrets.SSH_USER }} # SSH username for the server
key: ${{ secrets.SSH_KEY }} # SSH private key (added as GitHub secret)
script: |
cd /path/to/your/project # Replace with your project directory on the server
git pull public public # Pull updates from 'public' branch on 'public' remote

0 comments on commit 9d05281

Please sign in to comment.