- Make sure you've setup this repository and authenticated with the
gitbookCLI properly. - Once that is done, ensure that you have a GitHub App configured and published correctly.
Go to the integration folder at cd integrations/github. Before you run publish you must set a bunch of environment variables that are defined in the manifest file. In order to do that, open your GitHub App settings at https://github.com/settings/apps and then do the following
export GITHUB_APP_INSTALL_URL=https://github.com/apps/your-app-name/installations/new, and replaceyour-app-namewith whatever is the name of your app currently in the settings page URL.export GITHUB_APP_ID=app-id-from-settingsexport GITHUB_CLIENT_ID=client-id-from-settingsexport GITHUB_CLIENT_SECRET=client-secret-that-you-noted-down-earlierexport GITHUB_WEBHOOK_SECRET=webhook-secret-that-you-noted-down-earlierexport GITHUB_PRIVATE_KEY=`cat ~/Downloads/gitbook-dev-YOURNAME.key`
(this is the file that we converted from .pem to .key earlier. Make sure the file exists at the path)
Once you've exported these env variables, it's time to run the publish script:
gitbook publish --organization orgId where orgId will be the ID of your personal organization in your dev environment under which this integration should be published.
Important
Make sure to verify the published integration by storing verified: true on the integration object in the DB.