1、腾讯cos免费试用6个月:https://console.cloud.tencent.com/cos
2、创建好bucket:
3、Linux系统下coscmd工具安装,coscmd命令参考:https://cloud.tencent.com/document/product/436/10976
# yum install python3 # yum install gcc # pip3 install coscmd -i https://mirrors.aliyun.com/pypi/simple/ # 配置cos基本信息 [root@master ~]# cat /root/.cos.conf [common] secret_id = xxxxxxxx secret_key = xxxxxxxx bucket = jsonhc-1254359126 region = ap-shanghai
4、下载bucket数据到本地:
[root@master ~]# coscmd download logo.png ./ Download cos://jsonhc-1254359126/logo.png => ./logo.pn
logo.png这张照片在bucket:jsonhc-1254359126下面
5、通过github action对cos数据进行下载
- name: download bucket from cos uses: zkqiang/[email protected] with: args: download logo.png ./ secret_id: ${{ secrets.SECRET_ID }} secret_key: ${{ secrets.SECRET_KEY }} bucket: ${{ secrets.BUCKET }} region: ap-shanghai
执行结果如下:
标签:cos,coscmd,腾讯,bucket,secret,使用,logo,png From: https://www.cnblogs.com/jsonhc/p/18282764