Merge remote-tracking branch 'origin/upstream' #21
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Build project | |
run: | | |
corepack enable | |
pnpm install | |
pnpm docs:build && pnpm docs:lunaria:build | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: docs/.vitepress/dist | |
deploy-to-server: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
- name: Deploy to Server | |
uses: easingthemes/ssh-deploy@main | |
with: | |
REMOTE_HOST: ${{ secrets.SERVER_HOST }} | |
REMOTE_PORT: ${{ secrets.SERVER_PORT }} | |
REMOTE_USER: ${{ secrets.SERVER_USER }} | |
SSH_PRIVATE_KEY: ${{ secrets.SERVER_KEY }} | |
SOURCE: '.' | |
ARGS: '-azr --delete' | |
TARGET: '${{ secrets.SERVER_PATH }}/${{ github.event.repository.name }}/' |