From 9ab4918e86bb20d8698dea94fa41ebc845affc1c Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Sat, 2 Jun 2018 18:30:56 +0000 Subject: [PATCH] Deploy website Deploy website version based on 66e0e645706adafc88ea85b7dc369ea9c1a99eaa --- docs/en/next/publishing.html | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/en/next/publishing.html b/docs/en/next/publishing.html index 79956f91d6..47293cd9d4 100644 --- a/docs/en/next/publishing.html +++ b/docs/en/next/publishing.html @@ -158,6 +158,30 @@ - run: echo "Skipping tests on gh-pages branch"

Save this file as config.yml and place it in a .circleci folder inside your website/static folder.

+

Using Travis CI

+
    +
  1. Go to https://github.com/settings/tokens and generate a new personal access token
  2. +
  3. Using your GitHub account, add the Travis CI app to the repository you want to activate.
  4. +
  5. Open your Travis CI dashboard. The URL looks like https://travis-ci.com/USERNAME/REPO, and navigate to the More options > Setting > Environment Variables section of your repository.
  6. +
  7. Create a new environment variable named GH_TOKEN with your newly generated token as its value, then GH_EMAIL (your email address) and GH_NAME (your GitHub username).
  8. +
  9. Create a .travis.yml on the root of your repository with below text.
  10. +
+
# .travis.yml
+language: node_js
+node_js:
+  - '8'
+branches:
+  only:
+    - master
+cache:
+  yarn: true
+script:
+  - git config --global user.name "${GH_NAME}"
+  - git config --global user.email "${GH_EMAIL}"
+  - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
+  - cd website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
+
+

Now, whenever a new commit lands in master, Travis CI will run your suite of tests and, if everything passes, your website will be deployed via the publish-gh-pages script.

Hosting on Netlify

Steps to configure your Docusaurus-powered site on Netlify.

    @@ -172,7 +196,7 @@
  1. Click Deploy site

You can also configure Netlify to rebuild on every commit to your repo, or only master branch commits.

-
← Creating your siteAdding a Blog →