-
Notifications
You must be signed in to change notification settings - Fork 1
SDK, Workflow, Package, and docs updates #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6dc7c7a
Refactor and enhance maintainability across files (#12)
MWG-Logan 6dea923
ci: add Azure Static Web Apps workflow file
MWG-Logan 4f912bd
Bump Microsoft.AspNetCore.Components.WebAssembly from 10.0.0-rc.2.255…
dependabot[bot] 05a1f71
Move maxNotes constant to method scope in TicketsSection (#14)
Copilot 5f77e02
Bump Microsoft.Azure.Functions.Worker from 2.50.0-preview2 to 2.51.0 …
dependabot[bot] ac68949
Bump Microsoft.Azure.Functions.Worker.Sdk from 2.0.5 to 2.0.7 (#19)
dependabot[bot] 2e0d82a
Bump Markdig from 0.43.0 to 0.44.0 (#21)
dependabot[bot] 8c46d31
Bump Microsoft.Azure.Functions.Worker.ApplicationInsights from 2.0.0 …
dependabot[bot] 0627868
Bump Microsoft.AspNetCore.Components.WebAssembly from 10.0.0 to 10.0.…
dependabot[bot] fa5fc30
SWA auth (#24)
MWG-Logan 56b87c1
Bump Microsoft.AspNetCore.Components.WebAssembly.DevServer from 10.0.…
dependabot[bot] 18b28db
Update workflow for .NET 10 build and custom deployment (#20)
MWG-Logan 36935b9
Update Bezalu.ProjectReporting.API/README.md
MWG-Logan cfd5f27
Update .github/workflows/swa-deploy.yml
MWG-Logan 7884e0e
Update Bezalu.ProjectReporting.Web/wwwroot/staticwebapp.config.json
MWG-Logan 703286e
Update workflow to include permissions
MWG-Logan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Build and deploy .NET project to Azure Function App using OIDC | ||
|
|
||
| # CONFIGURATION | ||
| # | ||
| # This workflow can be used to deploy your .NET project to a function app on any hosting plan, except for Container Apps (which uses functions-container-action). | ||
| # | ||
| # For an overview of using GitHub workflows with Azure Functions, see https://learn.microsoft.com/azure/azure-functions/functions-how-to-github-actions | ||
| # | ||
| # 1. Configure a federated identity credential to your GitHub branch on an Azure user-assigned managed identity. | ||
| # For instructions, follow the README at https://github.com/Azure/functions-action#use-oidc-recommended | ||
| # | ||
| # 2. Add the following values from the managed identity to your repo's variables: | ||
| # AZURE_CLIENT_ID | ||
| # AZURE_TENANT_ID | ||
| # AZURE_SUBSCRIPTION_ID | ||
| # For instructions on creating repo variables, see https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-configuration-variables-for-multiple-workflows | ||
| # | ||
| # 3. Ensure your workflow is triggered by your desired event. By default, it is triggered when a push is made to main, and it can be manually run. | ||
| # For guidance on event triggers, see https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-events-to-trigger-workflows | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| AZURE_FUNCTIONAPP_NAME: ${{ vars.FUNCTION_APP_NAME }} | ||
| AZURE_FUNCTIONAPP_PROJECT_PATH: 'Bezalu.ProjectReporting.API' | ||
| DOTNET_VERSION: '10.0.x' | ||
| BUILD_ARTIFACT_NAME: 'Bezalu.ProjectReporting.API' | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest # Assumes your target function app is Linux-based | ||
| permissions: | ||
| id-token: write # Required for OIDC | ||
| contents: read # Required for actions/checkout | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| working-directory: ${{ env.AZURE_FUNCTIONAPP_PROJECT_PATH }} | ||
| steps: | ||
| - name: 'Checkout repository' | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: 'Set up .NET version: ${{ env.DOTNET_VERSION }}' | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
|
||
| # Perform additional steps such as running tests, if needed | ||
|
|
||
| - name: 'Build and prepare .NET project for deployment' | ||
| run: dotnet publish --configuration Release --output ./output | ||
|
|
||
| - name: Upload artifact for the deployment job | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ env.BUILD_ARTIFACT_NAME }} | ||
| path: ${{ env.AZURE_FUNCTIONAPP_PROJECT_PATH }}/output | ||
| include-hidden-files: true # Required for .NET projects | ||
|
|
||
| deploy: | ||
| runs-on: ubuntu-latest # Assumes your target function app is Linux-based | ||
| needs: build | ||
| permissions: | ||
| id-token: write # Required for OIDC | ||
| steps: | ||
| - name: 'Download artifact from build job' | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ env.BUILD_ARTIFACT_NAME }} | ||
| path: ./downloaded-artifact | ||
|
|
||
| - name: 'Log in to Azure with AZ CLI' | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ vars.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ vars.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: 'Run the Azure Functions action' | ||
| uses: Azure/functions-action@v1 | ||
| id: deploy-to-function-app | ||
| with: | ||
| app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | ||
| package: ./downloaded-artifact | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Azure Static Web Apps CI/CD | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, closed] | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build_and_deploy_job: | ||
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
| runs-on: ubuntu-latest | ||
| name: Build and Deploy Job | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: true | ||
| lfs: false | ||
|
|
||
| - name: Setup .NET 10.0 | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 10.0.x | ||
|
|
||
| - name: Install Workloads | ||
| run: dotnet workload restore | ||
|
|
||
| - name: Restore | ||
| run: dotnet restore | ||
|
|
||
| - name: .NET Publish | ||
| run: dotnet publish Bezalu.ProjectReporting.Web -c Release -o Bezalu.ProjectReporting.Web/publish | ||
|
|
||
| - name: List publish output for debugging | ||
| run: ls -al ./Bezalu.ProjectReporting.Web/publish/wwwroot | ||
|
|
||
| - name: Build And Deploy | ||
| id: builddeploy | ||
| uses: Azure/static-web-apps-deploy@v1 | ||
| with: | ||
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
| action: "upload" | ||
| app_location: 'Bezalu.ProjectReporting.Web/publish/wwwroot' | ||
| skip_api_build: true | ||
| skip_app_build: true | ||
|
|
||
| close_pull_request_job: | ||
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
| runs-on: ubuntu-latest | ||
| name: Close Pull Request Job | ||
| steps: | ||
| - name: Close Pull Request | ||
| id: closepullrequest | ||
| uses: Azure/static-web-apps-deploy@v1 | ||
| with: | ||
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | ||
| action: "close" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| window.saveFile = (base64, fileName, mime) => { | ||
| try { | ||
| const binary = atob(base64); | ||
| const len = binary.length; | ||
| const bytes = new Uint8Array(len); | ||
| for (let i =0; i < len; i++) bytes[i] = binary.charCodeAt(i); | ||
| const blob = new Blob([bytes], { type: mime || 'application/octet-stream' }); | ||
| const url = URL.createObjectURL(blob); | ||
| const a = document.createElement('a'); | ||
| a.href = url; | ||
| a.download = fileName || 'download'; | ||
| document.body.appendChild(a); | ||
| a.click(); | ||
| document.body.removeChild(a); | ||
| setTimeout(() => URL.revokeObjectURL(url),5000); | ||
| } catch (e) { | ||
| console.error('saveFile error', e); | ||
| } | ||
| try { | ||
| const binary = atob(base64); | ||
| const len = binary.length; | ||
| const bytes = new Uint8Array(len); | ||
| for (let i = 0; i < len; i++) bytes[i] = binary.charCodeAt(i); | ||
| const blob = new Blob([bytes], { type: mime || 'application/octet-stream' }); | ||
| const url = URL.createObjectURL(blob); | ||
| const a = document.createElement('a'); | ||
| a.href = url; | ||
| a.download = fileName || 'download'; | ||
| document.body.appendChild(a); | ||
| a.click(); | ||
| document.body.removeChild(a); | ||
| setTimeout(() => URL.revokeObjectURL(url), 5000); | ||
| } catch (e) { | ||
| console.error('saveFile error', e); | ||
| } | ||
MWG-Logan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.