Skip to content

Add CI workflow that tests then deploys to Azure App Service - #4

Merged
Ssavan99 merged 2 commits into
mainfrom
azure-deploy-workflow
Aug 9, 2026
Merged

Ssavan99 merged 2 commits into
mainfrom
azure-deploy-workflow

Conversation

@Ssavan99

@Ssavan99 Ssavan99 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

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

Trigger Behaviour
Pull request Build + all 31 tests. No deploy.
Push to \main\ Build + tests, then deploy if tests pass
Manual Same as push, via workflow_dispatch

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.

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +4 to +5
push:
branches: [main]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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>
@Ssavan99
Ssavan99 merged commit 756d4a6 into main Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant