update #96
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: prod | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "16.5.0" | |
- name: copy file via ssh key | |
uses: appleboy/scp-action@master | |
with: | |
source: "./*" | |
host: ${{ secrets.HOST }} | |
target: "/usr/src/zhoubichuan/prod/antdpro-express" | |
port: ${{ secrets.PORT }} | |
username: ${{ secrets.USER }} | |
password: ${{ secrets.PASSWORD }} | |
- name: Executing remote ssh commands | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USER }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd /usr/src/zhoubichuan/prod/antdpro-express | |
export NODE_HOME=/usr/bin/node | |
export PATH=$PATH:$NODE_HOME/bin | |
npm install | |
pm2 delete antdpro-express | |
pm2 start app.js --name antdpro-express |