egui/web_demo
lucasmerlin 0f290b4904
Add PR preview deployments (#5131)
This adds preview deployments that will deploy a version of
egui_demo_app for each pull request, making things easier to review /
test.

Some notes on security:
The preview deployment is split in two workflows, preview_build and
preview_deploy.
`preview_build` runs on pull_request, so it won't have any access to the
repositories secrets, so it is safe to
build / execute untrusted code.
`preview_deploy` has access to the repositories secrets (so it can push
to the pr preview repo) but won't run
any untrusted code (it will just extract the build artifact and push it
to the pages branch where it will
automatically be deployed).

To set this up, a DEPLOY_KEY secret needs to be added, which allows the
action to push the compiled artifacts into this repository:
https://github.com/egui-pr-preview/pr
The deploy key is the private key part of a key generated via
ssh-keygen. The public key is set as a deploy key in that repo.
I have created the repo on a separate github org, so it won't be
directly associated with emil or egui in case someone pushes something
naughty.

I have set this up in my fork of egui to show how this works:
- I created a PR: https://github.com/lucasmerlin/egui/pull/2
- The code will be compiled and pushed to the egui-pr-preview/pr repo
and deployed via github pages
- The bot leaves a comment on the pr with a link to the preview
- The preview is available at
https://egui-pr-preview.github.io/pr/2-pr-preview-demo/
(It's unfortunately only available a couple seconds after the bot writes
the comment, because the pages deployment action is run independently on
the other repository)
- Once the PR is merged / closed the preview will be cleaned up
(unfortunately the empty folder will remain, it seems like it's not
possible to remove that via the JamesIves/github-pages-deploy-action
action I use, but I don't think that it's a big issue)

I'll leave the PR in draft until the DEPLOY_KEY is set up
2024-09-20 09:08:58 +02:00
..
.gitignore Rename `docs/` to `web_demo/` 2023-11-16 16:44:30 +01:00
CNAME Rename `docs/` to `web_demo/` 2023-11-16 16:44:30 +01:00
README.md Change web demo local port to 8765 to avoid colliding with Jupyter 2024-06-28 08:37:21 +02:00
example.html Rename `docs/` to `web_demo/` 2023-11-16 16:44:30 +01:00
favicon.ico Rename `docs/` to `web_demo/` 2023-11-16 16:44:30 +01:00
index.html Add PR preview deployments (#5131) 2024-09-20 09:08:58 +02:00
multiple_apps.html Use canvas directly (#4780) 2024-07-15 18:59:15 +02:00

README.md

This folder contains the files required for the egui web demo hosted at https://www.egui.rs/.

Testing locally

Deploying egui.rs

Each merge into master will trigger a new deploy