-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.03 KB
/
cicd.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
name: CI
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 5.0.x
- name: Dotnet Publish
run: dotnet publish Wirtualnik.NET/Wirtualnik.Server/Wirtualnik.Server.csproj -c Release -o Release
- name: Remove not needed files
run: rm Release/appsettings.json; rm -rf Release/wwwroot
- name: Copy via ssh
uses: garygrossgarten/[email protected]
with:
local: Release
remote: ${{ secrets.REMOTE_TARGET }}
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
privateKey: ${{ secrets.REMOTE_SSH_KEY }}
- name: Run SSH command
uses: garygrossgarten/[email protected]
with:
command: sudo systemctl restart wirtualnik.service
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
privateKey: ${{ secrets.REMOTE_SSH_KEY }}