-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.18 KB
/
fe-cd.yaml
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: Frontend Deploy
on:
push:
branches:
- main
paths:
- frontend/**
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: "frontend/package-lock.json"
- name: Install modules
working-directory: frontend
run: npm ci
- name: Build
working-directory: frontend
run: npm run build
- name: Copy dist
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: docker-compose.yaml, frontend/dist/
target: ~/${{ github.event.repository.name }}
- name: Reload docker compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd ~/${{ github.event.repository.name }}
docker compose up -d fe