A site generated by MarkBind can be deployed by simply uploading the generated files to any Web server. In addition, MarkBind provides several convenient deployment options.
Generic steps for deploying a MarkBind site:
baseUrlproperty of the
site.jsonfile to match the deploy location.
markbind servecommand to stage the site locally and confirm the contents are as expected.
markbind buildcommand to generate the site from source files. That command puts the generated site files in a directory named
_site(you can change the output directory using parameters supplied to the command).
Steps for deploying multiple MarkBind sites:
site.jsonfiles. Ensure that the
baseUrlproperty of each
site.jsonfile matches its deploy location.
markbind serve -s <file>command to stage each site locally and confirm the contents are as expected.
markbind build -s <file>command to generate the site from source files.
MarkBind can easily deploy a site to Github pages if the project root directory is also a GitHub repo.
markbind deploy command will deploy the most recent build of your site to the
gh-pages branch of the repo
origin and will be available After the command is completed, your site
will be online at
http://<username|org>.github.io/<repo> e.g., http://se-edu.github.io/se-book.
If you are deploying to the site to GitHub pages, the
baseUrl setting in the
site.json should be set to the
"/<repositoryName>" for the links in the deployed site to work correctly.
Example: If you are using Github Pages to host your deployed website at repo
myorg/myproduct (i.e., the website is published at
https://myorg.github.io/myproduct), then your
baseUrl should be
You can override the default deployment settings (e.g., repo/branch to deploy) in the
The settings for auto-deployment to Github pages.
message [Optional. Default:
The commit message used for the deployment commit.
repo [Optional. Default: the current working project's repo]
The repo you want to deploy to.
"email@example.com:<org|username>/<repo>.git" if you use SSH)
branch [Optional. Default:
The branch that will be deployed to in the remote repo.
markbind deploy does not generate the static site from your source; it simply deploys the files that are already in the
_site directory. You need to run
markbind build first if you want to generate the
site before deploying.
You can setup
Since May 2018, Travis CI has been undergoing migration to
travis-ci.com, which changes the way you setup repositories on Travis CI.
travis-ci.org, you can continue to add your repository on
Review and addlink at the bottom of the list of organization and follow the steps to give Travis access to the organization containing your repo. After that, come back to the Repositories page and use the
Sync Accountbutton to sync your Travis account with GitHub.
GITHUB_TOKEN, with the value set to the personal access token generated in the previous step. Ensure that Display value in the build log is set to Off.
.travis.ymlfile to instruct Travis CI to build and deploy the site when you push to the repository. An example
.travis.ymlfile that can accomplish this is given below:
More information about
language: node_js node_js: - '8' install: - npm i -g markbind-cli script: markbind build && markbind deploy --travis branches: only: - master
.travis.ymlcan be found in the Travis CI documentation.
.travis.ymlto your MarkBind repository and push the changes. Travis CI should begin to build your site.
http://<username|org>.github.io/<repo>e.g., http://se-edu.github.io/se-book. Travis CI will automatically build and deploy changes to your site as you push new changes to the repository after a few seconds.
Settingsof your repo and configure it to publish GitHub Pages from the
gh-pagesbranch as MarkBind deploys to that branch by default.
When Travis CI is set up as explained above, it will use the latest version of MarkBind which may be a later version than the one you use locally.
v1.6.3), change the
installstep in the
.travis.ymlgiven above to:
install: - npm i -g firstname.lastname@example.org
^in front of the version number. In the example below, Travis will use the latest version of MarkBind but will stop before
install: - npm i -g markbind-cli@^1.63
When Travis CI is set up as explained above, Travis CI will attempt to deploy the site from any repository it is in, including forks. If you want Travis CI to only deploy from a specific repository (eg. only from your main site repository), you
can set a
deploy phase with an
For example, if you only want Travis CI to deploy the site when it is run from the
se-edu/se-book repository, the folllowing
deploy phase with the
on condition should be added to
deploy: on: repo: se-edu/se-book
repo value can be changed to your specific repository as desired.
You can setup
Here are the steps to set up Netlify:
New site from Git
Now your site will be deployed on Netlify at the given address specified after deployment. It will be updated automatically when the default branch of your repo is updated.
Note that when Netlify is set up as explained above, it will use the latest version of MarkBind which may be a later version than the one you use locally. If you want Netlify to use a specific version of Netlify, follow the instructions in the box below:
Here are the steps to set up Netlify to use a specific version of MarkBind.
Navigate to the root directory of your site.
npm init which will create
npm install email@example.com --save to install markbind as a dependency (using v1.6.3 as an example)
.gitignore file in the root directory and add:
ignore in site.json to include
Now, follow the previous instructions for setting up Netlify but with the following difference:
In step 5, Set the
Build Command to
markbind build --baseUrl