---
description: It's up to github or coding with one click
---

# One-click deployment of the hexo blog

## up.sh

{% hint style="info" %}
Before you do this, you need to make sure that you have configured SSH keys. If not, you can see the one-click SSH key generation tutorial, which was in the previous article.
{% endhint %}

You need to right-click git bash in the directory where the install.sh script is stored and run the following command:

```bash
source install.sh deploy
```

![下载up.sh](https://2469997499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlpfTEtpw-XHjloYx-t%2F-LlurwQcZHGhMvMGz358%2F-LlutGTSONJsGgLT-HB3%2F8.png?alt=media\&token=6b16f0f3-aaa4-4083-960c-e41031408d1a)

{% hint style="info" %}
You need to copy up.sh into the hexoblog file, which is your blog root directory
{% endhint %}

![](https://2469997499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlpfTEtpw-XHjloYx-t%2F-LluvTLNmEKB-I1ZDiSA%2F-LluzdSM_MrB7O9qCs1Z%2F9.png?alt=media\&token=bce8b33c-c6ec-4242-80fb-a0ac97e99d1a)

然后在存放up.sh脚本的目录中,右键打开git bash运行以下命令:

```bash
source up.sh
```

{% hint style="success" %}
It is then automatically deployed to your github or coding
{% endhint %}

{% hint style="danger" %}
If the upload fails you need to check to see if you have installed the latest version of \[hexo-script] or configured deploy information in the root directory.
{% endhint %}

{% hint style="danger" %}
If you don't know how to configure it, check out this tutorial:
{% endhint %}

## Deploy the necessary configuration for the blog

First you need to open the root configuration file \_config.yml

![](https://2469997499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlpfTEtpw-XHjloYx-t%2F-LluvTLNmEKB-I1ZDiSA%2F-LluxHhrwiYvRhAnlHXs%2F11.png?alt=media\&token=e5ccc9e5-a30f-4a56-86de-4bced0dae279)

> Find deploy, which is usually in the last line, and change it to the following format

![](https://2469997499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlpfTEtpw-XHjloYx-t%2F-LluvTLNmEKB-I1ZDiSA%2F-LluyCdpQ92nd8tuqn9Z%2F22.png?alt=media\&token=05f14980-032b-4997-b2b2-9bb31c28332d)

{% hint style="info" %}
You just need to modify the information behind the repo
{% endhint %}

```
deploy:
  type: git
  repo: Fill in your warehouse address here, it is recommended to use SSH address, which is beginning with git
  branch: master
```

After version 1.3 of \[heox-script] you do not need to install the upload plug-in yourself, but if an error is reported showing that the upload plug-in was not successfully installed, you need to execute the following command

```
cnpm install hexo-deployer-git --save
or you can run :npm install hexo-deployer-git --save
```

