Deployment
Version 1 · Document the GitHub Actions IIS deployment workflow
Deployment
DemonBets deploys automatically to IIS as the site WSB-Web through GitHub Actions.
Trigger
.github/workflows/deploy.yml runs on every push to dev, and can also be started
manually via workflow_dispatch.
Runner
A self-hosted runner labelled [self-hosted, Windows, X64, td-prod]. The IIS site
and build environment live on that production host, so deployment requires the td-prod
runner to be online.
Steps
- Checkout the repository (
actions/checkout@v4). - Setup Node.js 20 with npm cache (
actions/setup-node@v4). - Install dependencies —
npm ci. - Build —
npm run build(Vite build, output indist/). - Stop IIS site —
Stop-Website -Name "WSB-Web"(WebAdministration module). - Deploy — clear
C:\WebSites\WSB-Web(create it if missing) and copydist\*into it. - Start IIS site —
Start-Website -Name "WSB-Web". - Verify — check
Get-Website -Name "WSB-Web"reports stateStarted; fail the job otherwise.
SPA routing on IIS
web.config installs a URL Rewrite rule ("React Router") that rewrites any request
that is not an existing file or directory to /index.html, so client-side routes
(/search, /config, /race-card/:meetingId, ...) resolve correctly on refresh or
deep link. web.config is part of the build output and ships to the site root.
Manual build
npm ci
npm run build # production build -> dist/
npm run build:dev # development-mode build
npm run preview # serve the built dist/ locally
Notes
- The deploy replaces the entire site content each run (
Remove-Item dist\* -Recurse), so anything not produced by the build is not preserved on the server. - Because deploys are gated on push to
dev,devis effectively the release branch for this frontend.