Deploying Wikidatalite into Toolforge
I've noticed that GitHub Pages has been quite slow lately. Therefore, I am considering migrating it elsewhere.
Previously, I deployed Wikidatalite to GitHub Pages. However, I've noticed that GitHub Pages has been quite slow lately. Therefore, I am considering migrating it elsewhere.
Suddenly, I remembered Toolforge, a platform that allows hosting Wikimedia-related tools for free. Let's give it a try.
Go to toolsadmin.wikimedia.org, create an account, and create a new tool account.
Create a new git repository for that tool and upload your code to the repository.
Generate new public-private key pairs (you can use PuTTY Key Generator), add the public key to toolsadmin, and log in to SSH using the private key (`yourUNIXshellusername@login.toolforge.org`).
Via SSH console, run the following commands:
become yourtoolname
toolforge build start https://gitlab.wikimedia.org/toolforge-repos/yourtoolname
toolforge webservice --mount=none buildservice start
Done. Now your tool is accessible at `yourtoolname.toolforge.org`.
In my case, I just wanted to host a single `index.html` file, with all the functionality implemented using plain client-side JavaScript.
If you plan to deploy a more complex tool, your experience may differ from this deployment instruction.
Since I couldn't find an HTML deployment tutorial, I referred to the PHP deployment tutorial and made some modifications. With GitHub Pages, I could simply upload the `index.html` file and be done. But here, I had to create several additional files, such as `composer.json`, `composer.lock` and `Procfile`.
Most of these files were copied verbatim from the PHP deployment tutorial repository. The only difference was modifying the `Procfile` from:
heroku-php-apache2 src/
to
heroku-php-apache2
because my `index.html` is located in the root directory, not inside the `src` folder.