Skip to content

Update frontend--publish-azure.yml #337

Update frontend--publish-azure.yml

Update frontend--publish-azure.yml #337

name: Stage|API|Marketplace - Deploy to Azure
on:
#manually trigger deploy
workflow_dispatch:
#when we merge back up to main line, build and deploy
push:
branches: develop
#release:
# types: [created]
env:
# set this to your application's name
AZURE_WEBAPP_NAME: 'marketplace-back-stage'
# set this to the path to your solution file, defaults to the repository root (this is the folder in the git repo)
SOLUTION_DIRECTORY: './'
# set this to the path to your web app project, defaults to the repository root (this is the folder in the git repo)
PROJECT_DIRECTORY: './api/CESMII.Marketplace.API'
# Solution file to use
SOLUTION_FILE: 'CESMII.Marketplace.sln'
# Project file to use
PROJECT_NAME: 'CESMII.Marketplace.API'
PUBLISH_FOLDER_RELATIVE: "./publish"
PUBLISH_FOLDER: "/publish"
# set this to the .NET core version to use
NETCORE_VERSION: "6.0.x"
jobs:
build:
name: Build and Deploy .NET6 Web API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up dotnet Core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
- name: Restore dependencies (${{env.SOLUTION_FILE}})
run: dotnet restore ${{env.SOLUTION_FILE}}
working-directory: ${{env.SOLUTION_DIRECTORY}}
- name: Build (${{env.PROJECT_DIRECTORY}})
run: dotnet build --configuration Staging --no-restore
working-directory: ${{env.PROJECT_DIRECTORY}}
- name: Publish (${{env.PROJECT_DIRECTORY}}) TO ${{ env.PUBLISH_FOLDER_RELATIVE }}
run: dotnet publish --configuration Staging --output ${{ env.PUBLISH_FOLDER_RELATIVE }}
working-directory: ${{env.PROJECT_DIRECTORY}}
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.STAGE_AZURE_MARKETPLACE_BACK_PUBLISHSETTINGS }}
package: ${{ env.PROJECT_DIRECTORY }}${{ env.PUBLISH_FOLDER }}