Update to Azure Cosmos DB extension 4.x #19
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: deploy_backend | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'backend/**' | |
permissions: | |
id-token: write | |
env: | |
AZURE_FUNCTIONAPP_NAME: DrewDavisGetResumeCounter # set this to your application's name | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'backend' # set this to the path to your web app project, defaults to the repository root | |
DOTNET_VERSION: '7.0' # set this to the dotnet version to use | |
jobs: | |
build-and-deploy: | |
runs-on: windows-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v2 | |
- name: 'Login via Azure CLI' | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: 'Resolve Project Dependencies Using Dotnet' | |
shell: pwsh | |
run: | | |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/api' | |
dotnet build --configuration Release --output ./output | |
popd | |
- name: 'Run unit test' | |
shell: pwsh | |
run: | | |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/tests' | |
dotnet test | |
- name: 'Run Azure Functions Action' | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/api/output' |