Deploy Site To Server #5
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 Site To Server | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- ".vscode/**" | |
- ".env*" | |
- ".eslint*" | |
- "tsconfig*" | |
schedule: | |
# 北京时间凌晨5点 | |
- cron: "0 21 * * *" | |
jobs: | |
main-branch-deploy: | |
if: github.repository == 'Aisen60/vant-theme' | |
runs-on: ubuntu-latest | |
env: | |
# 设置时区环境变量 | |
TZ: Asia/Shanghai | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SECRETS_HOST }} | |
port: ${{ secrets.SECRETS_PORT }} | |
username: ${{ secrets.SECRETS_USERNAME }} | |
password: ${{ secrets.SECRETS_PASSWORD }} | |
script: | | |
cd /opt/cxs/vant-theme | |
git checkout . | |
git pull origin main | |
pnpm install | |
npm run build |