This page covers guidelines for deploying the Handsontable documentation.
The documentation is deployed via Netlify. A prod-docs/<MAJOR.MINOR> branch with the largest version number gets automatically tagged as the documentation's latest version.
The prod-docs/latest branch triggers a GitHub workflow that initiates a rebuild and deploys to Netlify on each push or when a new prod-docs/<MAJOR.MINOR> branch is created.
Handsontable's GitHub Actions setup deploys the documentation to Netlify.
Staging documentation is deployed on Netlify either automatically or manually based on the following diagram.
flowchart TD
Docs[Documentation Stage on Netlify]
Push[Push on files <pre>docs/*</pre>]
Manual[Manual <pre>workflow_dispatch</pre>]
PullRequest[Pull Request event]
PullRequestClose[Pull Request close]
Generate[Generate a preview at <pre>dev-handsontable-BRANCH_NAME.netlify.app</pre>]
Destory[Destroy, if exists, a preview at <pre>dev-handsontable-BRANCH_NAME.netlify.app</pre>]
Push -->|Automatic| Generate
Manual -->|Manual trigger on selected branch| Generate
PullRequest --> |Manual approve on PR page| Comment[Bot comments on PR page with URL] --> Generate
PullRequestClose --> |Automatic| Destory
Generate -->|Manual trigger| Destory
Docs --> Push
Docs --> Manual
Docs --> PullRequest
PullRequest --> PullRequestClose
To deploy the documentation to the staging environment, from GitHub Actions:
- Go to github.com/handsontable/handsontable/actions.
- Select the Docs Staging Deployment workflow.
- Select the Run workflow drop-down.
- Select the branch that you want to deploy.
- Select Run workflow.
On pull request page there will be pipeline in waiting mode that once approved will (re)generate a staging version of documentation and bot will send url in PR comment.
When pull request is closed staged version will be delegated to destroy.
To deploy the documentation to the production environment, from GitHub Actions:
- Go to github.com/handsontable/handsontable/actions.
- Select the Docs Production Deployment workflow.
- Select the Run workflow drop-down.
- Select the Docs production branch that you want to deploy (e.g
prod-docs/12.1). - Select Run workflow.
The deployment is handled entirely through Netlify. The netlify/ directory in the docs/ folder contains the Netlify configuration and build scripts used by the CI/CD pipeline.
To revert a production deployment to a previous version:
- Go to github.com/handsontable/handsontable/actions.
- Select the Docs Production Deployment workflow.
- Select Run workflow on the
prod-docs/<MAJOR.MINOR>branch with the desired version. - Alternatively, revert the commit on the
prod-docs/latestbranch and push - this will trigger an automatic Netlify rebuild.