Skip to main content

Sharing Prototypes #

Following this tutorial you will learn how to share access to prototypes created with Duet’s Command Line Interface through GitHub Pages.

Before moving further, please make sure you have contributor rights to Duet’s GitHub organization. If not, please contact our support. Additionally, please make sure you have at least version 1.2.0 of Duet CLI installed.

Getting started #

  1. As the first step, if you haven’t already done this, you should follow our CLI tutorial to create a new project. While doing this it’s important that you choose to initialize the project as a git repository.
  2. Once you have a project set up, you need to create a new remote repository under Duet’s GitHub organization. To do that, click here. When creating a new repository please make sure to follow our repository naming guidelines.
  3. Once finished, commit your changes, add the remote origin to your project, and push your first commit to git:
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:duetds/your-repository-name.git
git push -u origin main
  1. Pushing to main branch on git will automatically trigger build and deploy tasks on our CI server.
  2. After the first CI build is completed (you can verify this by switching to gh-pages branch on GitHub) you need to go to your repository’s settings, find a settings section called “GitHub Pages,” and once choose main and then gh-pages as the source. This is a required step to make GitHub register your new changes and transfer them to CDN.
  3. After these steps you can access your prototype using https://duetds.github.io/your-repository-name/ where your-repository-name is replaced with the actual name. Please note that it takes 10 minutes for all your changes to be visible on this URL after doing changes.
  4. To edit the credentials used to access the prototype, edit passphrase found from build:encrypt script in your project’s package.json.
Pro Tip: When changes are deployed they live in a subdirectory. This means your absolute or relative URLs might break if you aren’t careful. Our Eleventy templates come with a dynamic helper called duet.baseHref that you can use instead of e.g. “/”. This helper automatically determines what’s the needed base href in different environments.

Troubleshooting #

If you experience any issues while getting set up with Duet’s GitHub or CLI, please head over to the Support page for more guidelines and help.

Edit