-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.8 KB
/
main.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
name: Backend
on:
push:
paths:
- 'MyOwnGame.Backend/**'
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Подготовка
uses: actions/checkout@v4
- name: Установка .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x' # SDK Version to use.
- name: Компиляция проекта
run: dotnet publish -c Release -r linux-x64 --self-contained --output ./Release MyOwnGame.Backend
- name: Остановка сервера
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_SERVER }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATEKEY }}
passphrase: ${{ secrets.SSH_KEY_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
echo '${{ secrets.SSH_PASSWORD }}' | sudo -S systemctl stop sigame.service
- name: Копирование файлов на сервер
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_SERVER }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATEKEY }}
passphrase: ${{ secrets.SSH_KEY_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: "Release/*.*,!Release/appsettings.json"
target: "~/sigame/"
overwrite: true
- name: Запуск сервера
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_SERVER }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATEKEY }}
passphrase: ${{ secrets.SSH_KEY_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
echo '${{ secrets.SSH_PASSWORD }}' | sudo -S systemctl start sigame.service