a tools sync code to cdn, like aliyun oss.
- ACCESSKEYID: CDN Access Key ID
- ACCESSKEYSECRET: CDN Access Key Secret
- Sample Use
- name: Sync Code to CDN
uses: x-actions/go-sync@main
with:
provider: "aliyun"
access_key: ${{ secrets.ACCESSKEYID }}
access_secret: ${{ secrets.ACCESSKEYSECRET }}
endpoint: "<ENDPOINT>"
bucket: "<BUCKETNAME>"
source: "/github/workspace/public"
- Advance Use
- name: Sync Code to CDN
uses: x-actions/go-sync@main
with:
provider: "aliyun"
access_key: ${{ secrets.ACCESSKEYID }}
access_secret: ${{ secrets.ACCESSKEYSECRET }}
endpoint: "<ENDPOINT>"
bucket: "<BUCKETNAME>"
cache: "<some-path/<BUCKETNAME>.json>"
exclude: "str1,str2" # .git,.DS_Store
source: "/github/workspace/public"
ignore_expr: "" # "<li>Build <small>© .*</small></li>"
delete_objects: true
exclude_delete_objects: "<relative-of-source-path>,<relative-of-source-file>"
- download
curl -Lfs -o main https://github.com/x-actions/go-sync/releases/latest/download/gsync-{linux|darwin|windows}
chmod +x gsync
./gsync -h
- or build
git clone https://github.com/x-actions/go-sync.git
make all
- usage
./gsync \
-provider "aliyun" \
-access-key ${ALICLOUD_ACCESS_KEY} \
-access-secret ${ALICLOUD_SECRET_KEY} \
-bucket "dev-blog-xiexianbin-cn" \
-endpoint "oss-cn-hangzhou.aliyuncs.com" \
-source "/Users/xiexianbin/workspace/code/github.com/xiexianbin/note/public" \
-exclude ".git,.DS_Store" \
-ignore-expr "<li>Build <small>© .*</small></li>" \
-delete-objects=true \
-exclude-delete-objects "images/ads/aliyun.png,images/xiexianbin.png"
- fork from https://github.com/xiexianbin/webhooks
- ref for https://github.com/xiexianbin/gsync