Add CI workflow that tests then deploys to Azure App Service - #4
Conversation
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 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 485db3908a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| push: | ||
| branches: [main] |
There was a problem hiding this comment.
Prevent older runs from overwriting newer deployments
When two commits are pushed to main close together, this workflow allows both build-and-deploy runs to proceed concurrently; if the earlier run reaches Azure last because its build or upload is slower, it overwrites the newer production deployment with stale code. Add a deployment concurrency group, preferably with cancellation of superseded runs, so production ends on the latest commit.
Useful? React with 👍 / 👎.
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 <noreply@anthropic.com>
Replaces Azure's Deployment Center, which failed twice with \The role assignment already exists\ and would have generated a workflow that runs \dotnet publish\ at solution level — packaging the UnitTests project along with the app.
What this does
Deploy is a separate job gated on
eeds: build-and-test, so a failing test blocks the release rather than shipping a broken build.
Before this can deploy
A repository secret named \AZURE_WEBAPP_PUBLISH_PROFILE\ must exist, containing the App Service publish profile. Until it's added, the build-and-test job still runs and passes — only the deploy step fails.
Opening this as a PR means the build-and-test job validates itself here before anything touches production.