Practised Continuous Integration
Automated deployment
Cypress Testing
+1
I managed to write a somewhat proper CD thingy for a side project on Cloudflare Pages 🎉

In short: I set up a config that builds the app, then plays my tests with Cypress.io -> it actually deploys to prod only if the tests pass. The keystone of all this stuff: npm

Some technical details ⬇
My webapp (which is, for now, 100% front-end) depends on a "questions.js" file to work, which I build by parsing data provided in a config file with a home-made "build.rb" script (because I like Ruby).

I decided to read the official npm documentation and take the time to go through some tutorials, because I wanted to do things properly with Cypress. I created a package.json, and I ended up configuring what it just well enough for npm to do what I want âž¡ yay!

Of course, I had some "it doesn’t work on the cloud but it works on my machine" moments, but they were classics:
- I am on Windows, the CI/CD runs on Linux -> I fixed my file paths (something about "/" and "\")
- I used a good old . gitkeep to handle a writing problem in a non-existent folder

It was actually fun! Later, I plan to put tidy all this up a title (for instance: my automated tests are super anaemic, and I can certainly factor some of the code). I might also write a "how to" about all this (probably in French).