Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/x-actions/go-sync
a tools sync code to cdn, like aliyun oss.
https://github.com/x-actions/go-sync
actions aliyun cdn github githubactions oss
Last synced: about 2 months ago
JSON representation
a tools sync code to cdn, like aliyun oss.
- Host: GitHub
- URL: https://github.com/x-actions/go-sync
- Owner: x-actions
- License: apache-2.0
- Created: 2020-01-27T09:07:12.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T11:29:52.000Z (over 2 years ago)
- Last Synced: 2024-03-15T10:22:08.223Z (10 months ago)
- Topics: actions, aliyun, cdn, github, githubactions, oss
- Language: Go
- Homepage:
- Size: 278 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Action for Sync Code to CDN
[![build-test](https://github.com/x-actions/go-sync/actions/workflows/workflow.yaml/badge.svg)](https://github.com/x-actions/go-sync/actions/workflows/workflow.yaml)
[![GoDoc](https://godoc.org/github.com/x-actions/go-sync?status.svg)](https://pkg.go.dev/github.com/x-actions/go-sync)
[![Go Report Card](https://goreportcard.com/badge/github.com/x-actions/go-sync)](https://goreportcard.com/report/github.com/x-actions/go-sync)a tools sync code to cdn, like aliyun oss.
## Environment Variables
- ACCESSKEYID: CDN Access Key ID
- ACCESSKEYSECRET: CDN Access Key Secret## Usage
### Use as Github Action
- 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: ""
bucket: ""
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: ""
bucket: ""
cache: ".json>"
exclude: "str1,str2" # .git,.DS_Store
source: "/github/workspace/public"
ignore_expr: "" # "
delete_objects: true
exclude_delete_objects: ","
```
### Usage as command line
- 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 "
-delete-objects=true \
-exclude-delete-objects "images/ads/aliyun.png,images/xiexianbin.png"
```
## Others
- fork from https://github.com/xiexianbin/webhooks
- ref for https://github.com/xiexianbin/gsync