From 5c770ee501e2f6c93b68b96589ee9457c8cfb065 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Fri, 8 Dec 2017 23:47:52 +0000 Subject: [PATCH] Deploy website Deploy website version based on 6f3505d10f0bbccf62f259a448fe909a3ddb33e4 --- .circle/config.yml | 10 ---------- docs/en/publishing.html | 20 +++++++++++++++++--- 2 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 .circle/config.yml diff --git a/.circle/config.yml b/.circle/config.yml deleted file mode 100644 index 5f7ffe5986..0000000000 --- a/.circle/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Circle CI 2.0 Config File -# This config file will prevent tests from being run on the gh-pages branch. -version: 2 -jobs: - build: - machine: true - branches: - ignore: gh-pages - steps: - -run: echo "Skipping tests on gh-pages branch" diff --git a/docs/en/publishing.html b/docs/en/publishing.html index 3d84d330bd..c3c27a8036 100644 --- a/docs/en/publishing.html +++ b/docs/en/publishing.html @@ -30,7 +30,7 @@

While we recommend setting the above in siteConfig.js, you can also use environment variables ORGANIZATION_NAME and PROJECT_NAME.

-

One of the required parameters are set as environment variables:

+

One of the required parameters is set as a environment variable:

@@ -39,7 +39,7 @@
  • CURRENT_BRANCH: The branch that contains the latest docs changes that will be deployed. Usually, the branch will be master, but it could be any branch (default or otherwise) except for gh-pages.
  • -

    We currently require the published documentation to be served from the gh-pages branch in your GitHub repo.

    +

    Docusaurus also supports deploying user or organization sites. Just set your project name to "username.github.io" (where username is your username or organization name on GitHub) and the publish script will automatically deploy your site to the root of the master branch instead.

    Once you have the parameter value information, you can go ahead and run the publish script, ensuring you have inserted your own values inside the various parameter placeholders:

    To run the script directly from the command-line, you can use the following, filling in the parameter values as appropriate.

    @@ -50,7 +50,7 @@

    The specified GIT_USER must have push access to the repository specified in the combination of organizationName and projectName.

    -

    You should now be able to load your website by visiting its GitHub Pages URL, which could be something along the lines of https://organizationName.github.io/projectName, or a custom domain if you have set that up. For example, Docusaurus' own GitHub Pages URL is https://docusaurus.io (it can also be accessed via https://facebook.github.io/docusaurus), because it is served from the gh-pages branch of the https://github.com/facebook/docusaurus GitHub repo. We highly encourage reading through the GitHub Pages documentation to learn more about how this hosting solution works.

    +

    You should now be able to load your website by visiting its GitHub Pages URL, which could be something along the lines of https://username.github.io/projectName, or a custom domain if you have set that up. For example, Docusaurus' own GitHub Pages URL is https://docusaurus.io (it can also be accessed via https://facebook.github.io/docusaurus), because it is served from the gh-pages branch of the https://github.com/facebook/docusaurus GitHub repo. We highly encourage reading through the GitHub Pages documentation to learn more about how this hosting solution works.

    You can run the command above any time you update the docs and wish to deploy the changes to your site. Running the script manually may be fine for sites where the documentation rarely changes and it is not too much of an inconvenience to remember to manually deploy changes.

    However, you can automate the publishing process with continuous integration (CI).

    Automating Deployments Using Continuous Integration

    @@ -96,6 +96,20 @@ deployment:

    If you would rather use a deploy key instead of a personal access token, you can by starting with the Circle CI instructions for adding a read/write deploy key.

    +

    Tips & Tricks

    +

    When initially deploying to a gh-pages branch using Circle CI, you may notice that some jobs triggered by commits to the gh-pages branch fail to run successfully due to a lack of tests. You can easily work around this by creating a new file, .circleci/config.yml, in your gh-pages branch with the following contents:

    +
    # Circle CI 2.0 Config File
    +# This config file will prevent tests from being run on the gh-pages branch.
    +version: 2
    +jobs:
    +  build:
    +    machine: true
    +    branches:
    +      ignore: gh-pages
    +    steps:
    +      -run: echo "Skipping tests on gh-pages branch"
    +
    +

    Once you commit and push this file to your remote gh-pages branch on GitHub, Circle will skip running tests on the gh-pages branch.

    ← Creating your siteCustom Pages →