#GitHub Actions
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:
- Retype Build Action
- Retype GitHub Pages Action
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 is available to host from GitHub Pages. By default, the retype
branch is used, but of course that is also configurable, it can also be used to deploy to Netlify and a lot of other pages!
Automatically deploying to GitHub Pages requires a basic retype-action.yml configuration file to be added to your GitHub repo and some simple project configuration.
Content write
permission are required so that Retype and can automatically create the retype
branch and write the generated files into that branch.
#Summary
- Add a retype-action.yml file, see step 1
- Configure GitHub Pages, see step 2
- Set the branch to
retype
, see branch config - Set the
url
- 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 retype-action.yml workflow
Add the following retype-action.yml file to your GitHub project within the .github/workflows/
folder.
If the .github/workflows/
folders do not exist within the root of your project, you can manually create the folders and they will be committed along with the retype-action.yml.
The above retype-action.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.
If the default branch in your repo is master
, change - main
to - master
. If the docs project was within a docs
branch, change - main
to - docs
. The following snippet demonstrates setting the branch to master
.
Commit your .github/workflows/retype-action.yml file and push to your repo.
#RETYPE_SECRET
If your project requires a Retype license key, that key can be configured by adding a RETYPE_SECRET
secret to your repository settings and the corresponding env
configuration to your project .github/workflows/retype-action.yml file.
The following demonstrates a basic template to use for a workflow configuration file, if including the license key:
#RETYPE_PASSWORD
If your project uses either protected
or private
pages, adding a password for your visitors to use is required.
Only one password can be configured per project. The password protection functionality within Retype is not designed to be a comprehensive security layer with features such as multiple accounts or roles. Only the most basic password protection for pages is enabled.
A password can be configured by adding a RETYPE_PASSWORD
secret to your repository settings and the following env
configuration to your project .github/workflows/retype-action.yml file.
If both the RETYPE_SECRET
and RETYPE_PASSWORD
are needed, the configuration should be the following:
#Step 2: Configure GitHub Pages
Once Step 1 is complete, now configure your GitHub Pages web site hosting.