Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkqiang/tencent-cos-action
GitHub Actions for Tencent COS Command (coscmd)
https://github.com/zkqiang/tencent-cos-action
action actions cloud cos coscmd deploy github-action github-actions oss upload util
Last synced: 19 days ago
JSON representation
GitHub Actions for Tencent COS Command (coscmd)
- Host: GitHub
- URL: https://github.com/zkqiang/tencent-cos-action
- Owner: zkqiang
- License: mit
- Created: 2020-01-17T07:42:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T07:11:29.000Z (about 4 years ago)
- Last Synced: 2024-10-20T22:38:04.253Z (25 days ago)
- Topics: action, actions, cloud, cos, coscmd, deploy, github-action, github-actions, oss, upload, util
- Language: Shell
- Homepage: https://cloud.tencent.com/document/product/436/10976
- Size: 2.93 KB
- Stars: 45
- Watchers: 2
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 简介
该 [GitHub Action](https://help.github.com/cn/actions) 用于调用腾讯云
[coscmd](https://cloud.tencent.com/document/product/436/10976)
工具,实现对象存储的批量上传、下载、删除等操作。## workflow 示例
在目标仓库中创建 `.github/workflows/xxx.yml` 即可,文件名任意,配置参考如下:
```yaml
name: CIon:
push:
branches:
- masterjobs:
build:
runs-on: ubuntu-lateststeps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "10.x"- name: Build project
run: yarn && yarn build- name: Upload COS
uses: zkqiang/[email protected]
with:
args: delete -r -f / && upload -r ./dist/ /
secret_id: ${{ secrets.SECRET_ID }}
secret_key: ${{ secrets.SECRET_KEY }}
bucket: ${{ secrets.BUCKET }}
region: ap-shanghai
```其中 `${{ secrets.SECRET_XXX }}` 是调用 settings 配置的密钥,防止公开代码将权限密钥暴露,添加方式如下:
![](https://static.zkqiang.cn/images/20200118171056.png-slim)
## 相关参数
以下参数均可参见
[coscmd 官方文档](https://cloud.tencent.com/document/product/436/10976)| 参数 | 是否必传 | 备注 |
| --- | --- | --- |
| args | 是 | coscmd 命令参数,参见官方文档,多个命令用 ` && ` 隔开
如 `delete -r -f / && upload -r ./dist/ /` |
| secret_id | 是 | 从 [控制台-API密钥管理](https://console.cloud.tencent.com/cam/capi) 获取 |
| secret_key | 是 | 同上 |
| bucket | 是 | 对象存储桶的名称,包含后边的数字 |
| region | 是 | 对象存储桶的地区,[参见文档](https://cloud.tencent.com/document/product/436/6224) |