-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (76 loc) · 2.87 KB
/
deploy-canary.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Deploy to Canary
on:
push:
branches:
- "canary"
env:
AZURE_CANARY_WEBAPP_NAME: Canary-play-lingua-eu
AZURE_WEBAPP_PACKAGE_PATH: 'deployed-directory' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '3.1'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
# Setup nodejs
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: "12"
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Setup Front end dependencies
- name: Install dependencies
run: npm ci
working-directory: client
# Set LocalStorage secrets
- name: Set front-end secrets
uses: microsoft/variable-substitution@v1
with:
files: './client/src/environments/secretKeys.json'
env:
localStoragePrivateKey: ${{ secrets.LOCAL_STORAGE_PRIVATE_KEY }}
feedbackInvitationPrivateKey: ${{ secrets.FEEDBACK_INVITATION_PRIVATE_KEY }}
queryParameters: ${{ secrets.QUERY_PARAMETERS }}
# Run dotnet build and publish
- name: front end build
run: npm run build:prod
working-directory: client
# Set backend secrets
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: './server/PlayLingua.Host/appsettings.json'
env:
secret: ${{ secrets.SECRET }}
ConnectionStrings.playLinguaConnection: ${{ secrets.PLAYLINGUACONNECTION }}
hashKey: ${{ secrets.HASHKEY }}
email.username: ${{ secrets.EMAIL_USERNAME }}
email.password: ${{ secrets.EMAIL_PASSWORD }}
Environment.value: 'CANARY'
# Set google secrets
- name: Google secret Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: './server/PlayLingua.Host/speech-key.json'
env:
private_key_id: ${{ secrets.GOOGLE_PRIVATE_KEY_ID }}
private_key: ${{ secrets.GOOGLE_PRIVATE_KEY }}
# Run dotnet build and publish
- name: dotnet build and publish
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/myapp'
working-directory: server
# Deploy to Azure Web apps
- name: 'Azure webapp deploy'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_CANARY_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_CANARY }} # Define secret variable in repository settings as per action documentation
package: 'server/${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/myapp'