-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (40 loc) · 1.57 KB
/
Deploy-DotNet.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
name: DotNet-Deploy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: '${{ github.workspace }}/ModernaMediaDotNet/ModernaMedia/appsettings.json'
env:
ConnectionStrings.DefaultConnection: ${{ secrets.DEFAULTCONNECTION }}
TwillioSettings.phonenumber: ${{ secrets.TWILLIOPHONENUMBER }}
TwillioSettings.accountSid: ${{ secrets.TWILLIOACCOUNTSID }}
TwillioSettings.authToken: ${{ secrets.TWILLIOAUTHTOKEN }}
TwillioSettings.MessagingServiceSid: ${{ secrets.TWILLIOMESSAGINJGSERVICESID }}
- name: Dotnet publish
run: dotnet publish ModernaMediaDotNet/ModernaMediaDotNet.sln -c Release -o build
- name: Deploy to dev-server
uses: garygrossgarten/github-action-scp@release
with:
local: /home/runner/work/ModernaMedia/ModernaMedia/build
remote: /var/www/ModernaMedia/DotNet
command: ls
#remote: ${{ secrets.REMOTE_TARGET }}
host: ${{ secrets.HOST }}
username: ${{ secrets.HOST_NAME }}
password: ${{ secrets.HOST_PASSWORD }}
- name: Restart web-dev service
uses: garygrossgarten/[email protected]
with:
command: echo ${{ secrets.PRODPASS }} | sudo -S service ModernaMedia restart
host: ${{ secrets.HOST }}
username: ${{ secrets.HOST_NAME }}
password: ${{ secrets.HOST_PASSWORD }}