docs/deploy.md
Similar to GitBook, you can deploy files to GitHub Pages, GitLab Pages or VPS.
There are three places to populate your docs for your GitHub repository:
docs/ folderIt is recommended that you save your files to the ./docs subfolder of the main branch of your repository. Then select main branch /docs folder as your GitHub Pages source in your repository's settings page.
[!IMPORTANT] You can also save files in the root directory and select
main branch. You'll need to place a.nojekyllfile in the deploy location (such as/docsor the gh-pages branch)
If you are deploying your master branch, create a .gitlab-ci.yml with the following script:
[!TIP] The
.publicworkaround is socpdoesn't also copypublic/to itself in an infinite loop.
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
[!IMPORTANT] You can replace script with
- cp -r docs/. public, if./docsis your Docsify subfolder.
[!IMPORTANT] You'll need to install the Firebase CLI using
npm i -g firebase-toolsafter signing into the Firebase Console using a Google Account.
Using a terminal, determine and navigate to the directory for your Firebase Project. This could be ~/Projects/Docs, etc. From there, run firebase init and choose Hosting from the menu (use space to select, arrow keys to change options and enter to confirm). Follow the setup instructions.
Your firebase.json file should look similar to this (I changed the deployment directory from public to site):
{
"hosting": {
"public": "site",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
Once finished, build the starting template by running docsify init ./site (replacing site with the deployment directory you determined when running firebase init - public by default). Add/edit the documentation, then run firebase deploy from the root project directory.
Use the following nginx config.
server {
listen 80;
server_name your.domain.com;
location / {
alias /path/to/dir/of/docs/;
index index.html;
}
}
docs.docs in the Base Directory you will see the publish directory populated with docs/index.html file inside the docs/ folder.When using the HTML5 router, you need to set up redirect rules that redirect all requests to your index.html. It's pretty simple when you're using Netlify. Just create a file named _redirects in the docs directory, add this snippet to the file, and you're all set:
/* /index.html 200
npm i -g vercelcd docsvercelindex.html to history mode.<script>
window.$docsify = {
loadSidebar: true,
routerMode: 'history',
};
</script>
version: 0.1
frontend:
phases:
build:
commands:
- echo "Nothing to build"
artifacts:
baseDirectory: /docs
files:
- '**/*'
cache:
paths: []
| Source address | Target address | Type |
|---|---|---|
| /<*>.md | /<*>.md | 200 (Rewrite) |
| /<*>.png | /<*>.png | 200 (Rewrite) |
| /<*> | /index.html | 200 (Rewrite) |
npm run build but you can specify a custom build command on this page.docsRead more in the Stormkit Documentation.
Create docsify files
You need prepare the initial files instead of making them inside the container. See the Quickstart section for instructions on how to create these files manually or using docsify-cli.
index.html
README.md
Create Dockerfile
FROM node:latest
LABEL description="A demo Dockerfile for build Docsify."
WORKDIR /docs
RUN npm install -g docsify-cli@latest
EXPOSE 3000/tcp
ENTRYPOINT docsify serve .
The current directory structure should be this:
index.html
README.md
Dockerfile
Build docker image
docker build -f Dockerfile -t docsify/demo .
Run docker image
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
You can deploy Docsify as a Static Site on Kinsta.
Login or create an account to view your MyKinsta dashboard.
Authorize Kinsta with your Git provider.
Select Static Sites from the left sidebar and press Add sites.
Select the repository and branch you want to deploy.
During the build settings, Kinsta will automatically try to fill out the Build command, Node version, and Publish directory. If it won't, fill out the following:
18.16.0)docsClick the Create site.
DeployHQ is a deployment automation platform that deploys your code to SSH/SFTP servers, FTP servers, cloud storage (Amazon S3, Cloudflare R2), and modern hosting platforms (Netlify, Heroku).
[!IMPORTANT] DeployHQ does not host your site. It automates deploying your Docsify files to your chosen hosting provider or server.
To deploy your Docsify site using DeployHQ:
Sign up for a DeployHQ account and verify your email.
Create your first project by clicking on Projects and New Project. Connect your Git repository (GitHub, GitLab, Bitbucket, or any private repository). Authorize DeployHQ to access your repository.
Add a server and enter your server details:
public_html/)Since Docsify doesn't require a build step, you can deploy your files directly. If your Docsify files are in a docs/ folder, configure the Source Path in your server settings to docs/.
Click Deploy Project, then select your server and click Deploy to start your first deployment.
Your Docsify site will be deployed to your server. You can enable automatic deployments to deploy on every Git push, or schedule deployments for specific times.
For more information on advanced deployment features, see DeployHQ's documentation.