Add a simple GitHub Action to your project to automate the building and deployment of your Retype powered website.
Currently, there are two Retype related GitHub Actions:
The first, Build Action will automatically build your Retype powered website with each new change that is committed.
The second, GitHub Pages Action will automatically publish your newly built website to a branch in Github so it's available to host from GitHub Pages. By default, the
retype branch is used, but of course that is also configurable.
Automatically deploying to GitHub Pages requires a basic
retype.yml configuration file to be added to your GitHub repo and some simple project configuration.
- Add a
- Configure GitHub Pages, see
- Set the branch to
- Set the
- More details on the Retype Build Action.
- More details on the Retype GitHub Pages Action.
All of these options are configurable and your specific requirements may vary. There is a lot of flexibility. Please check out the Project Configuration options for full details.
Step 1: Add
Add the following
retype.yml file to your GitHub project within the
.github/workflows/ folder does not exist within the root of your project, you can manually create those folders and they will be committed along with the
name: Publish Retype powered website to GitHub Pages on: workflow_dispatch: push: branches: - main jobs: publish: name: Publish to retype branch runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: retypeapp/action-build@v1 - uses: retypeapp/action-github-pages@v1 with: update-branch: true
retype.yml workflow configuration instructs GitHub Actions to automatically build your website upon each commit to the
main branch, and then deploy your new Retype powered website to a
retype branch. If the
retype branch is not available, the GitHub Action will automatically create the branch.
retype.yml file and push to your repo.
Step 2: Configure GitHub Pages
With a few basic configs, GitHub can host your website for free.
To get started, navigate to the Settings > Pages page of your repo. The URL should be the following, although you'll need to replace
<repo> with your values:
Pick a branch
By default, the Retype Action will publish your website to the
retype branch, although you can configure it to host in any branch.
If you have committed the
retype.yml file as detailed in Step 1, you should now have a
retype branch available from the list. Select
retype then click the Save button.
Your GitHub Pages config should now look similar to the following:
We recommend that you check the Enforce HTTPS checkbox.
With the above sample, GitHub will provide a unique
github.io subdomain. Your website will be available from a subfolder of that subdomain. In our scenario, our website will be available in the
For example, the URL will use the following pattern:
You would then set the
url configuration with the following, where
<organization> is replaced with your GitHub organization name and
<repo> is replaced with your repository name.
If your GitHub organization name was
CompanyX and your repo name was
url config would be:
See url documentation.
Instead of using the
github.io domain, it is possible to configure GitHub Pages to use your custom domain or subdomain name.
Just enter your domain or subdomain name in the Custom domain field and click Save.
If your website will be available at
example.com as the Custom domain value.
If your website will be available at
You will then need to configure the DNS for your domain name.
The last step would be updating the
url project configuration with the same value. For example, if your website will be available at
https://example.com, use the following