-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) ยท 1.25 KB
/
TestFrontNginx.yml
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
50
51
name: Deploy Frontend To Nginx Test
on:
push:
branches: [ "FE/main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.5.1
- name: Check Node v
run: node -v
- name: Install dependencies
working-directory: ./front
run: npm install
- name: Generate build
working-directory: ./front
run: npm run build
- name: List contents of ./front/dist
run: ls -la ./front/dist
- name: Remove build folder in the server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
rm -rf /usr/share/nginx/build
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
password: ${{ secrets.SERVER_PASSWORD }}
source: front/dist
target: /usr/share/nginx/build