Update main.yml #43
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: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' # Specify Node.js version here | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm install | |
- 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" | |
cd /root/notes/Obsidian-Notes-Public # Replace with your project directory on the server | |
git pull origin public # Pull updates from the 'public' branch on 'origin' remote | |
cp -r /root/notes/Obsidian-Notes-Public/* /root/notes/quartz/content/ | |
# Navigate to the 'quartz' directory where package.json and package-lock.json are located | |
cd /root/notes/quartz/ | |
# Build Quartz | |
npx quartz build | |