-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (29 loc) · 1.03 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.deploy_ssh_key }}
known_hosts: 'placeholder'
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.deploy_host }} >> ~/.ssh/known_hosts
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release -o ./release --no-restore
- name: Deploy with rsync
run: rsync -avz --chmod=770 --exclude={'appsettings.*','*.pdb','*.dev','*.dev*'} ./release/ ${{ secrets.deploy_username }}@${{ secrets.deploy_host }}:/var/collabbot/
- name: Restart systemd service
run: ssh ${{ secrets.deploy_username }}@${{ secrets.deploy_host }} "sudo systemctl restart osu-collaboration-bot.service"