mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 19:57:25 +02:00
parent
ae2c063929
commit
a17693dd1b
1 changed files with 34 additions and 0 deletions
|
@ -263,6 +263,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.
|
||||
|
||||
## Deploying to Netlify
|
||||
|
||||
To deploy your Docusaurus 2 sites to [Netlify](https://www.netlify.com/), first make sure the following options are properly configured:
|
||||
|
|
Loading…
Add table
Reference in a new issue