-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.67 KB
/
deploy-backend-prod.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
name: (PROD) Deploy Backend
on:
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: vibes-backend-prod # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: './build' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '7.x.x' # set this to the dot net version to use
jobs:
build-backend-and-deploy:
runs-on: ubuntu-latest
environment: Production
steps:
# Checkout the repo
- uses: actions/checkout@main
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and publish
- name: Build
working-directory: backend/Api/
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release --property:PublishDir='./build'
# Deploy to Azure Web apps
- name: Deploy to App Service (NO)
uses: azure/webapps-deploy@v2
with:
app-name: vibes-backend-norway-prod
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_BACKEND_NO }} # Define secret variable in repository settings as per action documentation
package: 'backend/Api/build'
# Deploy to Azure Web apps
- name: Deploy to App Service (SE)
uses: azure/webapps-deploy@v2
with:
app-name: vibes-backend-sweden-prod
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_BACKEND_SE }} # Define secret variable in repository settings as per action documentation
package: 'backend/Api/build'