-
Notifications
You must be signed in to change notification settings - Fork 517
28 lines (26 loc) · 761 Bytes
/
Copy pathdeploy.yml
File metadata and controls
28 lines (26 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Deploy
on:
workflow_run:
workflows: [Sync To Gitee]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to remote server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd ${{ secrets.REMOTE_WORKDIR }}
git reset --hard origin/main
git pull
pnpm install
pnpm build
echo "${{ secrets.DEPLOY_ENV_FILE }}" > .env
echo "${{ secrets.DEPLOY_ENV_PROD_FILE }}" > .env.production
pnpm prod:pm2