Skip to content

Merge pull request #627 from louisaxel-ambroise/dependabot/nuget/MSTe… #89

Merge pull request #627 from louisaxel-ambroise/dependabot/nuget/MSTe…

Merge pull request #627 from louisaxel-ambroise/dependabot/nuget/MSTe… #89

name: Deploy to DEV API sandbox
env:
AZURE_WEBAPP_NAME: fastnt-dev
AZURE_WEBAPP_PACKAGE_PATH: '.'
DOTNET_VERSION: '9.0'
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
include-prerelease: True
- name: Set up dependency caching for faster builds
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build with dotnet
run: dotnet build --configuration Release
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/fastnt
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: .fastnt
path: ${{env.DOTNET_ROOT}}/fastnt
deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: 'Development'
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: .fastnt
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_API_APP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}