更新文档 #37
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: | |
# 切代码到 runner | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
# 下载 git submodule | |
- name: Update submodules | |
run: | | |
git submodule update --remote | |
# 使用 node 16.5.0 | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "16.5.0" | |
# npm install | |
- name: Install npm dependencies | |
run: npm install | |
- name: Run build task | |
run: npm run build | |
- name: copy file via ssh key | |
uses: appleboy/scp-action@master | |
with: | |
source: "web-node/*" | |
host: ${{ secrets.HOST }} | |
target: "/usr/src/zhoubichuan/prod/" | |
port: ${{ secrets.PORT }} | |
username: ${{ secrets.USER }} | |
password: ${{ secrets.PASSWORD }} |