The pipeline runs lint, format, tests, build, dependency audit and Lighthouse (mobile and desktop, Playwright Chromium on the arm64 runner) on every pull request, push to master and manual run. Pushes to master deploy to test automatically, and any branch can be deployed to test manually. Test is a Raspberry Pi with nginx next to the current WordPress site; the deploy refuses folders containing WordPress. Production deploys are manual and only from release/* branches, over FTP with TLS to the IIS webhost. The IIS web.config and both nginx configs are generated from the same security header list as the Vite servers, with a test that fails when the generated files drift. Adds .gitattributes for LF line endings and pins pnpm through packageManager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
Rollback Plan — frontend-shell
Principle (Q8 = B): roll back by deploying a previous version through the pipeline. The site is static: there is no state or database to undo.
Test environment
Old versions are not kept on test (keeping it simple). To go back, run the workflow on the branch, commit or tag you want, with Deploy to Test. This is the same route as production, so a rollback on test is also a rehearsal for production.
Production
- Choose the version. That is the previous tag (for example
v1.0.0) or the release branch from before the faulty change. - Deploy it. If the release branch still exists at that version, run the workflow on it with Deploy to Production. Otherwise create a branch from the tag first:
Then deploy that branch. Production deploys are only allowed from
git switch -c release/1.0-rollback v1.0.0 && git push -u origin release/1.0-rollbackrelease/*, which is why the branch is needed. - Check the result. The pipeline's post-deploy check verifies reachability and the CSP header. Also open a deep link (for example
/portfolio) and the home page. - Fix forward. Fix the problem on the release branch and deploy again as a new patch version.
Emergency (pipeline unavailable): run pnpm build locally from the tag, copy web/deploy/iis/web.config into dist/, and upload dist/ with FileZilla to wwwroot. Use "FTP over explicit TLS", and upload index.html last.
Before go-live
As long as the DNS points to the current host (D12), a broken production deploy affects no visitors. Fix it and deploy again.
Later: with the .NET API and a database
- Code: roll back the same way, by deploying the previous version.
- Database: do not roll back with "down" migrations, because they can destroy data. Instead:
- Make migrations backward compatible (expand/contract), so the previous API version still works on the new schema.
- Back up the database (or export it; the package allows 50 MB) before every production migration. The pipeline can do this as a step.
- Fix errors in data or schema with a new migration (roll forward).
- Restore from backup only as a last resort, when data was damaged.