catalog-service-ci-cd #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: catalog-service-ci-cd | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- src/services/catalog-service/api/** | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
environment: | |
description: 'Environment to run tests against' | |
type: environment | |
required: true | |
env: | |
Appservice: catalog-api-staging | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Build with dotnet | |
run: dotnet build ${{ github.workspace }}/src/services/catalog-service/api/catalog-service.csproj --configuration Release | |
- name: dotnet publish | |
run: dotnet publish ${{ github.workspace }}/src/services/catalog-service/api/catalog-service.csproj -c Release -o ${{env.DOTNET_ROOT}}/api | |
- name: Deploy to Azure Web App | |
uses: Azure/[email protected] | |
with: | |
app-name: food-catalog-api-yaml | |
publish-profile: ${{ secrets.CATALOG_SERVICE_PUBLISH }} | |
package: ${{env.DOTNET_ROOT}}/api |