rhaiscript / playground

A Rhai scripting playground that runs Rhai scripts using WebAssembly in a web browser.
https://rhai.rs/playground
MIT License
20 stars 5 forks source link

Move playground into Rhai org. #7

Closed schungx closed 3 years ago

schungx commented 3 years ago

Rhai now has its own org: https://github.com/rhaiscript

The project site resides here: https://rhaiscript.github.io

Would you like to move the Playground into the org?

alvinhochun commented 3 years ago

That sounds good to me.

How would you like to handle deployment? Currently it automatically does a build and deployment to my user GitHub Pages on every push to the master branch, which must be changed before moving. I suppose it can be changed to push to the gh-pages branch of this repo, which should then be accessible from https://rhaiscript.github.io/rhai-playground/ (assuming the repo name continues to be rhai-playground). This can also avoid polluting the commit history of the rhaiscript.github.io repo. But if you would like the site to host known stable builds then we can't have this automatic deployment.

schungx commented 3 years ago

rhaiscript.github.io is just one site... Not sure how we can automatically deploy to it other than just manually copying the files over...

schungx commented 3 years ago

But if you would like the site to host known stable builds then we can't have this automatic deployment.

Yes, come to think of it, I think it is important for the playground to be stable as well. So we might need to separate dev builds from the stable build.

alvinhochun commented 3 years ago

rhaiscript.github.io is just one site... Not sure how we can automatically deploy to it other than just manually copying the files over...

I've been using a github workflow for this: https://github.com/alvinhochun/rhai-playground/blob/master/.github/workflows/dist.yml

It makes use of an ssh private key to be able to push to the alvinhochun.github.io repository, which is why it will have to be changed. I think a github action has the access right to push to its own repo, so by changing it to push to the gh-pages branch instead it would work nicely.

Yes, come to think of it, I think it is important for the playground to be stable as well. So we might need to separate dev builds from the stable build.

We can make the automatic builds available in a sub-directory dev/ and manually deploy known-good builds to stable/.

I will need a bit of experimentation to find out what works.

schungx commented 3 years ago

Maybe we can make a key just for the playground deployment and you can use it to deploy?

alvinhochun commented 3 years ago

Maybe we can make a key just for the playground deployment and you can use it to deploy?

No need for that. I've changed the action to deploy to the gh-pages branch (https://github.com/alvinhochun/rhai-playground/tree/gh-pages) without needing a key. At this time it is accessible via https://alvinhochun.github.io/rhai-playground/dev/. In theory, when I transfer the repo to the rhaiscript organization and rename the repository to just playground, it should become accessible via https://rhaiscript.github.io/playground/dev/.

The stable/ dir will be for manually publishing known-good builds.

I will also add a top-level (i.e. https://rhaiscript.github.io/playground/) index.html for redirecting visitors to stable/.

After transferring, I will also make the old URLs https://alvinhochun.github.io/rhai-demo/ and https://alvinhochun.github.io/rhai-playground-unstable/ redirect to the new stable URL. You can then start changing the documentations and the book to point to the new URL. There are also several references inside this repo that will need changing (I'll check later).

I think this will be all. Have I missed anything? If not then I'll proceed with the transfer.

schungx commented 3 years ago

Nope. Go ahead and let's see if it works!

schungx commented 3 years ago

which should then be accessible from https://rhaiscript.github.io/rhai-playground/

Come to think of it, this won't work. rhaiscript is an organization, meaning that its GitHub Pages site comes from a repo called rhaiscript.github.io. You'll need to deply to a directory under rhaiscript.github.io.

alvinhochun commented 3 years ago

which should then be accessible from https://rhaiscript.github.io/rhai-playground/

Come to think of it, this won't work. rhaiscript is an organization, meaning that its GitHub Pages site comes from a repo called rhaiscript.github.io. You'll need to deply to a directory under rhaiscript.github.io.

Not a problem. The repo has been transferred and it is now accessible as https://rhaiscript.github.io/rhai-playground/dev/.

There is one problem though - now I don't have the access right to rename the repo to playground...

schungx commented 3 years ago

You're now admin for the repo. Try again!

alvinhochun commented 3 years ago

Ok, renamed and now https://rhaiscript.github.io/playground/dev/ and https://rhaiscript.github.io/playground/stable/ is up!

schungx commented 3 years ago

Can you make a redirect from https://rhaiscript.github.io/playground to https://rhaiscript.github.io/playground/stable?

schungx commented 3 years ago

Or just keep the stable version at https://rhaiscript.github.io/playground

It would be more intuitive to access the playground at https://rhaiscript.github.io/playground

alvinhochun commented 3 years ago

I added the redirect. It would be nice to have a shorter URL, but at this time the webpack build spits all the resources to the same directory as index.html and I don't like having an actually meaningful sub-dir dev/ alongside with a bunch of files with garbage names. I think it will be prone to errors since the stable build is to be updated manually.

alvinhochun commented 3 years ago

I've added redirects from the old URLs and changed the link references in this repo (also verified that the github action still works). I think the transfer can be considered done, at least regarding the things inside this repo.