Skip to content

also updating main yml file with email settings #42

also updating main yml file with email settings

also updating main yml file with email settings #42

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy ASP.Net Core app to Azure Web App - CVZandreBotha
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.301'
- name: variable substitution
uses: microsoft/variable-substitution@v1
with:
files: 'OnlinePortfolioZB/OnlinePortfolioZB/appsettings.json'
env:
EmailSettings.SENDGRID_API_KEY: ${{secrets.SENDGRID_API_KEY}}
EmailSettings.SENDER_NAME: ${{secrets.FROM_EMAIL_NAME}}
EmailSettings.FROM_EMAIL: ${{secrets.FROM_EMAIL}}
- name: Build with dotnet
run: dotnet build OnlinePortfolioZB/OnlinePortfolioZB/OnlinePortfolioZB.csproj --configuration Release
- name: dotnet publish
run: dotnet publish OnlinePortfolioZB/OnlinePortfolioZB/OnlinePortfolioZB.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'CVZandreBotha'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_d54a716a66284e929bfd604bd1a98c0b }}
package: ${{env.DOTNET_ROOT}}/myapp