docs/README-DEPLOYMENT.md
This page covers guidelines for deploying the Handsontable documentation.
A prod-docs/<MAJOR.MINOR> branch with the largest version number gets automatically tagged as the documentation's latest version.
Our server configuration watches for images tagged with :v12.1, :v13.0 and so on, and automatically refreshes after detecting a newer version.
Before generating the documentation, set Docker's runtime memory limit.
The recommended runtime memory limit is 8 GB. It allows us to generate 4 documentation versions at a time.
Handsontable's GitHub Actions setup deploys the documentation based on the following Docker image tags:
| Docker image tag | Build type | Triggered by | Used for |
|---|---|---|---|
:v12.1, v13.0 etc. | Production | A push that changes docs/** on the Docs production branch e.g prod-docs/12.1 | Automatic production deployment |
:v12.1-[COMMIT_HASH], :v13.0-[COMMIT_HASH] etc. | Production | A push that changes docs/** on the Docs production branch e.g prod-docs/12.1 | Images used for backups |
Staging documentation is being deployed on netlify either automatic on 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[Destory, if exsist, 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
workflow_dispatch manual trigger on any branchTo deploy the documentation to the staging environment, from GitHub Actions:
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:
docs-prod/12.1).To deploy the documentation to the production environment, from the command line:
When deploying for the first time, log in to the GitHub Container Registry (ghcr.io):
docker login --registry docker.pkg.github.com
write:packages permission: https://github.com/settings/tokens/newDeploy the documentation:
npm run docs:docker:build:production
docker push docker.pkg.github.com/handsontable/handsontable/handsontable-documentation:v12.1
To revert a production deployment to a previous version (on the example of a broken version 12.1):
[COMMIT_HASH]:
docker pull docker.pkg.github.com/handsontable/handsontable/handsontable-documentation:v12.1-[COMMIT_HASH]
production Docker tag refer to your [COMMIT_HASH] version:
docker tag docker.pkg.github.com/handsontable/handsontable/handsontable-documentation:v12.1-[COMMIT_HASH] docker.pkg.github.com/handsontable/handsontable/handsontable-documentation:v12.1
production Docker image (which is your [COMMIT_HASH] version now) back to the registry:
docker push docker.pkg.github.com/handsontable/handsontable/handsontable-documentation:v12.1