-
Notifications
You must be signed in to change notification settings - Fork 24
139 lines (109 loc) · 3.83 KB
/
deploy-ftp.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Deploy FTP
on:
push:
branches: [ "main" ]
env:
WEB_API_PROJECT: src/Server/Logistics.API/Logistics.API.csproj
WEB_API_FTP_FOLDER: logistics-api/
IDENTITY_SERVER_PROJECT: src/Server/Logistics.IdentityServer/Logistics.IdentityServer.csproj
IDENTITY_SERVER_FTP_FOLDER: logistics-id/
ADMIN_APP_PROJECT: src/Client/Logistics.AdminApp/Logistics.AdminApp.csproj
ADMIN_APP_FTP_FOLDER: logistics-admin/
OFFICE_APP_PATH: src/Client/Logistics.OfficeApp
OFFICE_APP_OUTPUT_PATH: dist/logistics.office-app/
OFFICE_APP_FTP_FOLDER: logistics-office/
jobs:
test-dotnet:
name: .NET Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test --no-build --verbosity normal
deploy-office-app:
name: Deploy Office App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: ${{ env.OFFICE_APP_PATH }}/package-lock.json
- name: Install dependencies
run: npm install --prefix ${{ env.OFFICE_APP_PATH }} --force
- name: Build
run: npm run build --prefix ${{ env.OFFICE_APP_PATH }}
- name: Deploy to host
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ${{ env.OFFICE_APP_PATH }}/${{ env.OFFICE_APP_OUTPUT_PATH }}
server-dir: ${{ env.OFFICE_APP_FTP_FOLDER }}
deploy-web-api:
name: Deploy Web API
runs-on: windows-latest
needs: [test-dotnet]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish ${{ env.WEB_API_PROJECT }} -c Release -r win-x86 -p:PublishSingleFile=true --self-contained true --output ./Release
- name: Deploy to host
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: Release/
server-dir: ${{ env.WEB_API_FTP_FOLDER }}
deploy-identity-server:
name: Deploy Identity Server
runs-on: windows-latest
needs: [test-dotnet]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish ${{ env.IDENTITY_SERVER_PROJECT }} -c Release -r win-x86 -p:PublishSingleFile=true --self-contained true --output ./Release
- name: Deploy to host
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: Release/
server-dir: ${{ env.IDENTITY_SERVER_FTP_FOLDER }}
deploy-admin-app:
name: Deploy Admin App
runs-on: windows-latest
needs: [test-dotnet]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish ${{ env.ADMIN_APP_PROJECT }} -c Release -r win-x86 -p:PublishTrimmed=true --self-contained true --output ./Release
- name: Deploy to host
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: Release/
server-dir: ${{ env.ADMIN_APP_FTP_FOLDER }}