Skip to content

Commit

Permalink
update to identity for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
eoinobrien committed Jul 2, 2024
1 parent baf5764 commit 7cb9903
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions .github/workflows/build_test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [ master ]
release:
types: [ created ]
workflow_dispatch:

env:
DOTNET_VERSION: '8.0.x'
Expand Down Expand Up @@ -35,30 +36,38 @@ jobs:
run: dotnet test --no-restore --verbosity normal

build-and-deploy:
runs-on: ubuntu-latest
runs-on: windows-latest
needs: build-and-test
environment: production
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- 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: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration Release --output ./output
popd
- name: 'Resolve Project Dependencies Using Dotnet'
shell: pwsh
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration Release --output ./output
popd
- 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 }}/output'
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_145AC1BCFD3F4AF3BCDBBFD23D1FC58C }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_342581E108E64446985A202EEC1A224F }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F51A0FC4A0D44919A2D7585FE6451931 }}

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'LuasAPIFunction'
slot-name: 'Production'
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'

0 comments on commit 7cb9903

Please sign in to comment.