Create security-hub.md #87
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- v4 | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.6.0 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Project | |
run: npx quartz build | |
- name: Set up ssh | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/key | |
chmod 600 ~/.ssh/key | |
ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts | |
- name: Check Build Status | |
id: check_build | |
run: | | |
if [ -d public ]; then | |
echo "Build succeeded" | |
else | |
echo "Build failed" | |
exit 1 | |
fi | |
- name: rsync Files to Remote Server | |
if: success() | |
run: rsync -avz -e "ssh -i ~/.ssh/key" --delete /home/runner/work/Notes/Notes ${{ secrets.USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_PATH }} | |