Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
oigbokwe73 committed Feb 6, 2025
2 parents 888bf9c + 39d987f commit 39de0a0
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/master_training20250205.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy dotnet core app to Azure Function App - training20250205

on:
push:
branches:
- master
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use
AZURE_STORAGE_ACCOUNT: 'training20250205'
AZURE_STORAGE_CONTAINER: 'config'
SOURCE_FOLDER: './config' # Change this to your folder path


jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write #This is required for requesting the JWT
contents: read #This is required for actions/checkout

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- 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 }}'
dotnet build --configuration Release --output ./output
popd
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_8A0791B3BFAD487D8BBD6B34324B6F4B }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_0BC0EE63700541308905A13F2D0A0B85 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E0D657C2E0634D47A689BECBAA812924 }}

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

- name: Azure CLI Action
uses: Azure/cli@v2.1.0
with:
inlineScript: |
echo "Uploading files to Azure Storage Container..."
az storage blob upload-batch \
--account-name ${{ env.AZURE_STORAGE_ACCOUNT }} \
--destination ${{ env.AZURE_STORAGE_CONTAINER }} \
--source ${{ env.SOURCE_FOLDER }} \
--pattern "*" --overwrite

0 comments on commit 39de0a0

Please sign in to comment.