# Publish to Heroku

Easily publish your documentation using Heroku by just uploading the raw project and letting Retype build for you!

With the dedicated Retype Buildpack for Heroku, any retype project can be published to Heroku in just a few steps!

This guide will use the Heroku CLI to go through four simple steps to publish this very website to a freshly created Heroku App.


# Step 1: Clone this website's repository

To clone this website on your end using the git commandline client, issue the following command:

Make a local clone of retype.com website
git clone https://github.com/retypeapp/retype

It will then create a retype directory containing a copy of this website.

# Switch to the repository folder

This is important for Heroku to be able to set up the repository remotes in the next step.

Switch into the repository folder
cd retype

# Step 2: Create the app

Run the following in your command prompt:

New app using the Heroku CLI.
heroku create my-app-name

# Step 3: Enable Retype Buildpack

Set Retype Buildpack using the Heroku CLI
heroku buildpacks:set https://github.com/retypeapp/heroku-buildpack

This will do the actual magic: With this, once the documentation project is pushed to Heroku, our dedicated buildpack will kick in and handle the documentation build!


# Step 4: Publish the project

Now, simply push the repository to heroku using the git command:

Push the repository
git push heroku main

The git push process should take a few seconds to complete. Once it is done, the last lines of output should show the full URL to your app. With the app name used in this guide, it would be https://my-app-name.herokuapp.com/.


# Publishing your own project

Any documentation project set up to be built with retype can be replaced in step 1. The buildpack requires a retype.yml file in order to build the documentation. The file may be provided in different ways:

  • a retype.yml file at the root of the repository
  • a retype.yml file anywhere in the repository
  • the full path to a directory containing retype.yml, specified via the Heroku config var RETYPE_CONFIG
  • the full path to the file. The specified file will then be used as retype.yml regardless of its name; also specified via Heroku config var](https://devcenter.heroku.com/articles/config-vars) RETYPE_CONFIG

If there's no retype.yml file in the repository, just run retype watch and adjust the settings to your liking in the just-created retype.yml, then commit it. Your project would then be ready to be pushed to Heroku.

See Quick Start for details on retype watch, and see Configuration > Project for possible retype.yml config values.


# Summary

  • Grab a local copy of Retype's Website, see step 1.
  • Create the Heroku App, see step 2.
  • Instruct the app to use Retype's Buildpack, see step 3.
  • Publish (by pushing the repo to Heroku), see step 4.

# Further Reading