Skip to content

Commit

Permalink
feat: 更新说明文件
Browse files Browse the repository at this point in the history
  • Loading branch information
her-cat committed Aug 2, 2023
1 parent 76caa0c commit 6eca6e2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# GitHub Action to deploy your site to upyun

This GitHub operation will deploy your site to upyun. For more information, please refer to [https://her-cat.com/posts/2023/01/31/blog-migration-to-upyun/](https://her-cat.com/posts/2023/01/31/blog-migration-to-upyun/).
This GitHub Action will deploy your site to upyun. For more information, please refer to [https://her-cat.com/posts/2023/01/31/blog-migration-to-upyun/](https://her-cat.com/posts/2023/01/31/blog-migration-to-upyun/).

## Inputs

- `bucket`: **Required** The service name you are using on upyun.
- `operator`: **Required** Your operator's account on upyun.
- `password`: **Required** Your operator's password on upyun.
- `dir`: **Optional** The directory where the site is located. The default value is an empty string.
- `dir`: **Optional** The directory where the file you want to upload is located. The default value is an empty string.
- `publish_dir`: **Optional** Upload to the specified directory. The default value is an empty string.

## Example usage

For example, if you want to upload all the files in the **public** directory under the repository to upyun's **myblog** directory, you need to set `dir` to **public** and `publish_dir` to **myblog**.

> Note that if you want to upload all the files in the root directory of the repository, or upload to the root directory of upyun, you just need to set the directory to empty or not set this parameter.
```yml
name: Deploy to UpYun

Expand All @@ -28,7 +33,7 @@ jobs:
uses: actions/checkout@master

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v1.0.1
with:
hugo-version: '0.101.0'

Expand All @@ -41,10 +46,11 @@ jobs:
bucket: ${{ secrets.UPYUN_BUCKET }}
operator: ${{ secrets.UPYUN_OPERATOR_NAME }}
password: ${{ secrets.UPYUN_OPERATOR_PWD }}
dir: public
dir: 'public'
publish_dir: 'myblog'
```
Before use, you need to configure `Actions secrets` in the repository settings. The static files generated by hugo are saved in the public directory by default, so here `dir` is set to `public`.
Before use, you need to configure `Actions secrets` in the repository settings. The static files generated by hugo are saved in the public directory by default, so here `dir` is set to **public**.

## License

Expand Down

0 comments on commit 6eca6e2

Please sign in to comment.