-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ssh
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |