Files
blog-frontEnd/.github/workflows/build.yml
2020-10-08 11:22:47 +08:00

49 lines
1.2 KiB
YAML

name: Build
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install
- run: npm run lint && npm run build:prod
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.1.4
with:
name: dist
path: ./dist/index/*
- name: Package products
- run: cd dist/index/ && tar -cf index.tar ./* && cp index.tar ../../
- name: SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: "index.tar"
target: "/www/wwwroot/www.celess.cn"
- name: Run SSH command
uses: garygrossgarten/github-action-ssh@v0.5.0
with:
command: cd /www/wwwroot/www.celess.cn && bash deploy.sh
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}