Skip to content

Feat/added dice rolling (#12) #13

Feat/added dice rolling (#12)

Feat/added dice rolling (#12) #13

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
branches: [ master, main ]
env:
AZURE_WEBAPP_NAME: 'WebApiCICDWorkFlow' # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: './publish_output' # set this to the path to your web app project, defaults to the repository root
BUILD_CONFIGURATION: 'Release' # set this to the appropriate build configuration
DOTNET_VERSION: '8.x.x' # set this to the dotnet version to use
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Restore - Install dependencies
run: dotnet restore ./WebApiCICDWorkFlow.sln
- name: Build with dotnet
run: dotnet build ./WebApiCICDWorkFlow.sln --configuration ${{env.BUILD_CONFIGURATION}} --no-restore
- name: Test with dotnet
run: dotnet test ./WebApiCICDWorkFlow.Tests/WebApiCICDWorkFlow.Tests.csproj --configuration ${{env.BUILD_CONFIGURATION}} --verbosity normal
- name: Publish with dotnet
run: dotnet publish ./WebApiCICDWorkFlow/WebApiCICDWorkFlow.csproj --configuration ${{env.BUILD_CONFIGURATION}} --no-build --output ${{env.AZURE_WEBAPP_PACKAGE_PATH}}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: WebApiCICDWorkFlow_Production
path: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}