# Uptoc
uptoc 是一个用于将静态文件部署到云存储的命令行工具,它通常配合持续集成平台使用。当然你也可以安装在你的本地使用。
# 驱动
- 阿里云Oss
- 腾讯云Cos
- 七牛云Kodo
- AWS S3
- Google Storage
# 安装
homebrew (可能不是最新版本):
brew install uptoc
homebrew tap:
brew install saltbo/bin/uptoc
Shell script:
curl -sSf https://uptoc.saltbo.cn/install.sh | sh
deb/rpm:
从Release页面下载.deb或.rpm,然后分别使用dpkg -i和rpm -i安装。
manually:
从Release页面下载预编译的二进制文件,然后复制到所需位置。
# 使用
# 基本使用
uptoc --region cn-beijing --access_key LTAI4FxxxxxxxBXmS3 --access_secret Vt1FZgxxxxxxxxxxxxKp380AI --bucket demo-bucket /opt/blog/public
其中,access_key和access_secret支持环境变量
export UPTOC_UPLOADER_AK=LTAI4FxxxxxxxBXmS3
export UPTOC_UPLOADER_SK=Vt1FZgxxxxxxxxxxxxKp380AI
uptoc --region cn-beijing --bucket blog-bucket /opt/blog/public
# Github Actions
同时,uptoc也是一个GitHub Actions。所以你可以直接在你的actions里使用它。
steps:
- name: Deploy
uses: saltbo/uptoc@master
with:
driver: oss
region: cn-zhangjiakou
bucket: saltbo-blog
exclude: .cache,test
dist: public
env:
UPTOC_UPLOADER_AK: ${{ secrets.UPTOC_UPLOADER_KEYID }}
UPTOC_UPLOADER_SK: ${{ secrets.UPTOC_UPLOADER_KEYSECRET }}
# Typora编辑器
在本地配置相关信息: live
uptoc config
在Typora中配置自定义命令: 
# 驱动配置
| driver | bucket | region | region enum |
|---|---|---|---|
| oss | ut-uptoc | cn-hangzhou | Regions |
| cos | ut-uptoc-1255970412 | ap-shanghai | Regions |
| qiniu | ut-uptoc | cn-east-1 | Regions |
| ut-uptoc | auto | - | |
| s3 | ut-uptoc | ap-northeast-1 | Regions |