Skip to content

(PROD) Deploy Backend #16

(PROD) Deploy Backend

(PROD) Deploy Backend #16

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'