See the Self-hosting documentation for further up-to-date details.
Fork, clone and install
Fork the live-codes/livecodes
GitHub repo and clone it. You may wish to use the included setup to deploy to GitHub Pages (see steps below):
Build, serve and deploy
Build and publish to Github
If you wish to host the app on Github pages, the base URL of the documentation directory needs to be supplied by the environment variable DOCS_BASE_URL
during build.
Complete these steps before deploying via
npm run deploy
-
Under your Github profile, navigate to Settings > Developer settings > Fine-grained tokens.
-
Click Generate new token.
-
Name the token
GH_ACTIONS_REPO_PAT
, choose expiration date and give it a description. -
Under Repository access, select Only select repositories and select the appropriate repository.
-
Under Permissions > Repository permissions > Actions, select Read and write.
-
Click the Generate token button at the bottom of the page.
Your token will be generated. Make sure to copy your personal access token now as you will not be able to see it again.
-
Go to
https://github.com/{your-username}/livecodes
-
Click Settings in the menu
-
Click Environments in the menu
-
Click github-pages
-
Under Environment secrets, click Add secret
-
Name the secret
GH_ACTIONS_REPO_PAT
and paste your token from step 6. -
Click Add secret button
-
Click Pages in the left-side menu
-
Choose the Source > Deploy from a branch.
-
Select the
gh-pages
branch with/(root)
folder and click the Save button. -
After some time, the page will refresh with:
- Your site is live at
https://{your-username}.github.io/livecodes/
- Click the Visit site button to see the deployed Livecodes instance hosted by Github
- Your site is live at