From 6c6ae146eb2521794e83dc0113189e6ea16cb061 Mon Sep 17 00:00:00 2001 From: aakhtar3 Date: Sun, 4 Oct 2020 23:32:46 -0400 Subject: [PATCH 1/2] docs(v1): added drone for 1.0 #3491 --- .../docs/getting-started-publishing.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/website-1.x/docs/getting-started-publishing.md b/website-1.x/docs/getting-started-publishing.md index 43fe0ce6da31..8771afff7f9b 100644 --- a/website-1.x/docs/getting-started-publishing.md +++ b/website-1.x/docs/getting-started-publishing.md @@ -289,6 +289,40 @@ steps: displayName: 'yarn install and build' ``` +### Using Drone + +1. Create a new ssh key that will be the [deploy key](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys) for your project. +1. Name your private and public keys to be specific and so that it does not overwrite your other [ssh keys](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). +1. Go to https://github.com/USERNAME/REPO/settings/keys and add a new deploy key by pasting in our public key you just generated. +1. Open your Drone.io dashboard and login. The URL looks like https://cloud.drone.io/USERNAME/REPO. +1. Click on the repository, click on activate repository, and add a secret called `git_deploy_private_key` with your private key value that you just generated. +1. Create a `.drone.yml` on the root of your repository with below text. + +```yaml +# .drone.yml +kind: pipeline +type: docker +trigger: + event: + - tag +- name: Website + image: node + commands: + - mkdir -p $HOME/.ssh + - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts + - echo "$GITHUB_PRIVATE_KEY > $HOME/.ssh/id_rsa" + - chmod 0600 $HOME/.ssh/id_rsa + - cd website + - npm i + - npm run publish-gh-pages + environment: + USE_SSH: true + GIT_USER: $DRONE_COMMIT_AUTHOR + GITHUB_PRIVATE_KEY: git_deploy_private_key +``` + +Now, whenever you push a new tag to github, this trigger will start the drone ci job to publish your website. + ### Hosting on Vercel Deploying your Docusaurus project to [Vercel](https://vercel.com/) will provide you with [various benefits](https://vercel.com/) in the areas of performance and ease of use. From a587d8e597406e67b6cb111361c9def865ac5d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Mon, 5 Oct 2020 12:49:16 +0200 Subject: [PATCH 2/2] Update getting-started-publishing.md --- .../getting-started-publishing.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/website-1.x/versioned_docs/version-1.14.5/getting-started-publishing.md b/website-1.x/versioned_docs/version-1.14.5/getting-started-publishing.md index a377f7be373c..ae9cbe7c61d6 100644 --- a/website-1.x/versioned_docs/version-1.14.5/getting-started-publishing.md +++ b/website-1.x/versioned_docs/version-1.14.5/getting-started-publishing.md @@ -290,6 +290,40 @@ steps: displayName: 'yarn install and build' ``` +### Using Drone + +1. Create a new ssh key that will be the [deploy key](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys) for your project. +1. Name your private and public keys to be specific and so that it does not overwrite your other [ssh keys](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). +1. Go to https://github.com/USERNAME/REPO/settings/keys and add a new deploy key by pasting in our public key you just generated. +1. Open your Drone.io dashboard and login. The URL looks like https://cloud.drone.io/USERNAME/REPO. +1. Click on the repository, click on activate repository, and add a secret called `git_deploy_private_key` with your private key value that you just generated. +1. Create a `.drone.yml` on the root of your repository with below text. + +```yaml +# .drone.yml +kind: pipeline +type: docker +trigger: + event: + - tag +- name: Website + image: node + commands: + - mkdir -p $HOME/.ssh + - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts + - echo "$GITHUB_PRIVATE_KEY > $HOME/.ssh/id_rsa" + - chmod 0600 $HOME/.ssh/id_rsa + - cd website + - npm i + - npm run publish-gh-pages + environment: + USE_SSH: true + GIT_USER: $DRONE_COMMIT_AUTHOR + GITHUB_PRIVATE_KEY: git_deploy_private_key +``` + +Now, whenever you push a new tag to github, this trigger will start the drone ci job to publish your website. + ### Hosting on ZEIT Now With [ZEIT Now](#using-zeit-now), you can deploy your site and connect it to [GitHub](https://zeit.co/github) or [GitLab](https://zeit.co/gitlab) to automatically receive a new deployment every time you push a commit.