Deploy online
Usage with PsiTurk
While this set up is optimized for Electron, we added functionality that will make use with PsiTurk easy. The application will detect if it's being used in a Turk environment and will:
- Save the data to the default PsiTurk SQLite database.
- Switch the language to Turk specific, if
src/language/<locale>.mturk.json
exists. - Use the Turk-specific timeline if different than the primary timeline.
Prebuilt version
When GitHub Actions is run, a PsiTurk build will be created automatically, and can be downloaded from its artifacts (skip next step if using). The workflows responsible for building the PsiTurk application are .github/workflows/package-home-all.yml
and .github/workflows/release-home-all.yml
. The first one has to be triggered manually, the latter is triggered when you tag a release.
Build instructions
To set up your PsiTurk project, we provide a script that does the conversion. PsiTurk is a Python package used to manage HITs in Mechanical Turk. Before using the provided script, install PsiTurk.
You'll need to follow these steps (the path to the PsiTurk project should be a directory you wish to be created):
-
Build the application:
npm run build
-
Move to the
psiturkit
directory:cd psiturkit
-
If it's the first time you're running the script:
./psiturk-it -p <PATH_TO_NEW_PSITURK_PROJECT>
-
To update an existing PsiTurk project (the path to the PsiTurk project should already exist from the previous steps):
./psiturk-it -u -p <PATH_TO_NEW_PSITURK_PROJECT>
Running PsiTurk
After that, just navigate to your newly created PsiTurk project directory.
shell> psiturk #start psiturk
psiturk> server on #start server
psiturk> debug #debug mode
Running on the Web
Using Github Pages
Running npm run build
generates static content into the build
directory that can be served using any static contents hosting service. The workflow .github/workflows/release-home-all.yml
uploads the build directory to the gh-branch
to serve the application on GitHub pages as an example. After a creating a tag, the workflow will run and your application will be served at <github user>.github.io/<repository>
.
For this step to succeed you will need to create a deploy key and enable GitHub Pages for your repository.
-
Generate a new SSH key.
-
By default, your public key should have been created in
~/.ssh/id_rsa.pub
or use the name you've provided. -
Copy key to clipboard with
xclip -sel clip < ~/.ssh/id_rsa.pub
and paste it as a deploy key in your repository. Copy file content if the command line doesn't work for you. Check the box forAllow write access
before saving your deployment key. -
You'll need your private key as a GitHub secret to allow the workflow to run the deployment for you.
-
To create the secret, copy your private key (e.g.,
xclip -sel clip < ~/.ssh/id_rsa
) and paste a GitHub secret with nameGH_PAGES_DEPLOY
. Copy file content if the command line doesn't work for you. Save your secret. -
Make sure the publishing source for your repository is configured for
gh-pages
branch.