From 485db3908af8ec3717f9e569fdd464bffa016de0 Mon Sep 17 00:00:00 2001 From: Ssavan99 <58150774+Ssavan99@users.noreply.github.com> Date: Sat, 8 Aug 2026 21:30:08 -0500 Subject: [PATCH 1/2] Add CI workflow that tests then deploys to Azure App Service Azure's Deployment Center failed twice with a role-assignment conflict, and the workflow it generates runs dotnet publish at solution level, which would also try to package the UnitTests project. This is written by hand instead. - Build and run all 31 tests on every push and pull request - Publish only Boggle/Boggle.csproj, so the test project is excluded - Deploy to Azure only on main; pull requests are validated but never deployed - Deploy is a separate job gated on tests passing, so a red test blocks release Requires an AZURE_WEBAPP_PUBLISH_PROFILE repository secret. Co-Authored-By: Claude Opus 5 --- .github/workflows/azure-deploy.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/azure-deploy.yml diff --git a/.github/workflows/azure-deploy.yml b/.github/workflows/azure-deploy.yml new file mode 100644 index 0000000..dc5ebd7 --- /dev/null +++ b/.github/workflows/azure-deploy.yml @@ -0,0 +1,70 @@ +name: Build, test and deploy + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +env: + # The App Service resource name. Azure appends a unique suffix to the public + # hostname (boggle-fxe8hwa0duhvc8hc.centralus-01.azurewebsites.net), but the + # resource name itself is just this. + AZURE_WEBAPP_NAME: boggle + DOTNET_VERSION: '8.0.x' + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Restore + run: dotnet restore Boggle.sln + + - name: Build + run: dotnet build Boggle.sln --configuration Release --no-restore + + - name: Test + run: dotnet test UnitTests/UnitTests.csproj --configuration Release --no-build --verbosity normal + + # Publish only the web project. The solution also contains UnitTests, + # and publishing at solution level would try to package that too. + - name: Publish + if: github.event_name != 'pull_request' + run: dotnet publish Boggle/Boggle.csproj --configuration Release --output ./publish + + - name: Upload artifact + if: github.event_name != 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: webapp + path: ./publish + + deploy: + # Pull requests are built and tested, but never deployed. + if: github.event_name != 'pull_request' + needs: build-and-test + runs-on: ubuntu-latest + environment: + name: production + url: ${{ steps.deploy.outputs.webapp-url }} + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: webapp + path: ./publish + + - name: Deploy to Azure Web App + id: deploy + uses: azure/webapps-deploy@v3 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ./publish From 655767c3ca795eda2fcbc3899cce6d6c1a2472db Mon Sep 17 00:00:00 2001 From: Ssavan99 <58150774+Ssavan99@users.noreply.github.com> Date: Sat, 8 Aug 2026 21:43:05 -0500 Subject: [PATCH 2/2] Bump workflow actions to current major versions The initial versions were pinned to Node 20 runtimes, which GitHub now forces onto Node 24 and warns about on every run. checkout v4 to v7, setup-dotnet v4 to v6, upload-artifact v4 to v7, download-artifact v4 to v8. azure/webapps-deploy stays on v3, which is the current major despite the releases page listing a v2.x as latest. Co-Authored-By: Claude Opus 5 --- .github/workflows/azure-deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-deploy.yml b/.github/workflows/azure-deploy.yml index dc5ebd7..7ea22e6 100644 --- a/.github/workflows/azure-deploy.yml +++ b/.github/workflows/azure-deploy.yml @@ -1,4 +1,4 @@ -name: Build, test and deploy +name: Build, test and deploy on: push: @@ -18,9 +18,9 @@ jobs: build-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v6 with: dotnet-version: ${{ env.DOTNET_VERSION }} @@ -41,7 +41,7 @@ jobs: - name: Upload artifact if: github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: webapp path: ./publish @@ -56,7 +56,7 @@ jobs: url: ${{ steps.deploy.outputs.webapp-url }} steps: - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: webapp path: ./publish