-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (32 loc) · 1.01 KB
/
CD.yml
File metadata and controls
41 lines (32 loc) · 1.01 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
name: CD
on:
push:
branches:
- main
jobs:
deployment:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- name: Stop Discord Bot Service
env:
SUDOER: ${{ secrets.SUDO_CD }}
run:
echo "$SUDOER" | xargs sudo -S service code2gether-discord-bot stop
echo "$SUDOER" | xargs sudo -S service code2gether-discord-bot-api stop
- name: Publish
run: dotnet publish -c "Release" -o "/home/ubuntu/Code2Gether-Discord-Bot/release"
- name: Start Discord Bot service
env:
SUDOER: ${{ secrets.SUDO_CD }}
run:
echo "$SUDOER" | xargs sudo -S service code2gether-discord-bot restart
#echo "$SUDOER" | xargs sudo -S service code2gether-discord-bot-api restart
- name: Clean Bash History
continue-on-error: true
run:
cat /dev/null > ~/.bash_history && history -cw