Update main.yml #33
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: Pull on GitHub Repo Update | |
on: | |
push: | |
branches: | |
- public # Triggers on push to the 'public' branch | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- 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 | |
password: ${{ secrets.SSH_PASSWORD }} # Password for SSH authentication (added as GitHub secret) | |
key: ${{ secrets.SSH_KEY }} # SSH private key (added as GitHub secret) | |
script: | | |
echo "SSH Connection Successful" | |
cd /notes/Obsidian-Notes-Public # Replace with your project directory on the server | |
git pull public public # Pull updates from 'public' branch on 'public' remote | |
cp -r /root/notes/Obsidian-Notes-Public/* /root/notes/quartz/content/ | |
cd /root/notes/quartz/ | |
npx quartz build |