Update main.yml #46
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 # GitHub Actions runs in this environment | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Deploy to Server via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
password: ${{ secrets.PASSWORD }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
echo "SSH Connection Successful" | |
# Add Node.js to PATH if it's not already | |
export PATH=/usr/local/bin:$PATH | |
# Ensure we're using the right Node.js and npm versions | |
node -v | |
npm -v | |
# Run your commands as needed | |
cd /root/notes/Obsidian-Notes-Public | |
git pull origin public | |
cp -r /root/notes/Obsidian-Notes-Public/* /root/notes/quartz/content/ | |
# Navigate to the quartz directory | |
cd /root/notes/quartz/ | |
# Build Quartz | |
npx quartz build |