-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.64 KB
/
deploy-front.yml
File metadata and controls
60 lines (50 loc) · 1.64 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
50
51
52
53
54
55
56
57
58
59
60
# Деплой фронта при push в ветку front-prod (мерж PR → front-prod).
# Сборка client/ и загрузка на хостинг по FTP (домашняя директория FTP-пользователя: /www/dayflow.today).
name: Deploy Frontend (prod)
on:
push:
branches: [front-prod]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: |
client/package-lock.json
shared/package-lock.json
- name: Install shared dependencies
run: npm ci --prefix shared
- name: Build shared
run: npm run build --prefix shared
- name: Install client dependencies
run: npm ci --prefix client
- name: Build client
run: npm run build --prefix client
env:
VITE_GRAPHQL_URL: ${{ secrets.VITE_GRAPHQL_URL || 'https://api.example.com/graphql' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: front-dist
path: client/dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: front-dist
- name: Deploy via FTP
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./
server-dir: ./
dangerous-clean-slate: false