Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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: "" # "

  • Build © .*
  • "
    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 "

  • Build © .*
  • " \
    -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