Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Github Pages Setup

Alex Gaesser edited this page May 13, 2020 · 3 revisions

HOME » PAPUA SETUP GUIDE » Github Pages Setup

Deploying with Github Pages

This section covers deploying a standalone frontend using Github Pages. To deploy the complete service, please see Setting Up PAPUA

With this method, you'll be able to quickly get your form hosted without having to configure AWS infrastructure or custom backend components. This method is great for standing up a self-guided qualifaction wizard, or if you want to use PAPUA templating with a non-AWS backend.

Requirements:

  • GitHub account
  1. Fork this repo
  2. Update the predeploy script found in package.json to https://<username>.github.io/<repository>/
  3. [Optional] Update the questions used in your state's PAPUA form by editing forms.yml and committing those changes to the master branch of your fork.
  4. [Optional] Update the state logo by dropping a <state code>.png file into public and committing that change to the master branch of your fork.
  5. [Optional] Update the API call. By default, PAPUA make a post request to an AWS endpoint, this will break with non-Amplify deployments.

Remove or change the below code block to match your needs. (You can also remove the submit button altogether)

// src/components/FormApp.tsx
const resp = await API.post('resolverAPI', '/claims', {
  body: {
    metadata: {
      uuid: uuid(window.location.hostname, uuid.DNS),
      timestamp: new Date(),
      host: window.location.hostname,
    },
    questions: values,
  },
}).
  1. [Optional] Configure a custom domain on github.com, found under Settings in your fork. [See the docs.][7]
  2. To deploy:
yarn install
yarn predeploy
yarn deploy

Your form is now hosted at https://<username>.github.io/<repository>/

Clone this wiki locally