-
Notifications
You must be signed in to change notification settings - Fork 92
49 lines (44 loc) · 1.2 KB
/
build.yml
File metadata and controls
49 lines (44 loc) · 1.2 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install npm dependencies
run: npm install
- name: Run build
run: npm run build
- name: Get Path
run: pwd
- name: Zip
run: zip -q -r dist.zip ./dist
- name: Ls
run: ls
- name: 'Copy'
uses: appleboy/scp-action@v0.1.4
env:
HOST: ${{ secrets.REMOTE_HOST }}
USERNAME: ${{ secrets.REMOTE_USER }}
KEY: ${{ secrets.SSH_PRIVATE_KEY }}
PORT: ${{ secrets.REMOTE_PORT }}
SOURCE: ./dist
TARGET: /www/temp/www
- name: mv
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.REMOTE_PORT }}
script: |
sudo rm -rf /www/www/*
sudo cp -r -f /www/temp/www/dist/* /www/www
sudo rm -rf /www/temp/www/*