That's when I came across Travis' [GitHub Pages Deployment integration](https://docs.travis-ci.com/user/deployment/pages/).
Add the following snippet to your `.travis.yml`:
```yaml
deploy:
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
local_dir: build
on:
branch: master
```
Now create a new [Personal Access Token](https://github.com/settings/tokens) on GitHub and make sure to include the `public_repo` scope (or the `repo` scope if you're deploying from a private repository).
Copy the provided token and execute the following code in a shell:
(make sure to replace `thetokenyougot` with the actual token)
Now whenever you push to the `master` branch, Travis will run your build first, then grab all files from the `build` folder, put that into a new commit in the `gh-pages` branch and force-push to GitHub again.
For more settings check the linked documentation (e.g. how to change the folder or branch to be deployed).
Meanwhile, [this became the documented method for Cobalt deployment](https://github.com/cobalt-org/cobalt.rs/pull/333).