File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 2020 with :
2121 node-version : " 22.x"
2222
23+ - name : Setup Python
24+ uses : actions/setup-python@v5
25+ with :
26+ python-version : " 3.11"
27+
2328 - name : Build project
2429 run : npm i -g pnpm && pnpm install && pnpm build
2530
@@ -29,15 +34,16 @@ jobs:
2934 ls -la dist/
3035 echo "Total files: $(find dist -type f | wc -l)"
3136
37+ # 使用 coscmd 替代 cos-action,可输出更清晰的错误信息
3238 # BUCKET 格式需为 bucketname-appid,如 mysite-1234567890
33- # 确保 GitHub Secrets 中 SECRET_ID、SECRET_KEY、BUCKET 已正确配置
39+ - name : Setup coscmd
40+ run : pip install coscmd
41+
42+ - name : Configure coscmd
43+ run : |
44+ coscmd config -a ${{ secrets.SECRET_ID }} -s ${{ secrets.SECRET_KEY }} \
45+ -b ${{ secrets.BUCKET }} -r ap-shanghai
46+
3447 - name : Upload COS
35- uses : TencentCloud/cos-action@v1
36- with :
37- secret_id : ${{ secrets.SECRET_ID }}
38- secret_key : ${{ secrets.SECRET_KEY }}
39- cos_bucket : ${{ secrets.BUCKET }}
40- cos_region : ap-shanghai
41- local_path : dist
42- remote_path : /
43- clean : true
48+ run : |
49+ coscmd upload -rfs --delete dist/ /
You can’t perform that action at this time.
0 commit comments