Skip to content

Commit 9d25cd7

Browse files
authored
chore: use rclone to sync oss (#1591)
1 parent 3c9e639 commit 9d25cd7

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: build
33
on:
44
push:
55
branches: [main]
6+
pull_request:
7+
branches: [main]
68

79
permissions:
810
id-token: write
@@ -20,6 +22,19 @@ jobs:
2022
- run: |
2123
yarn install
2224
yarn build:cn
25+
- name: Install RClone
26+
run: |
27+
curl https://rclone.org/install.sh | sudo bash
28+
- name: Configure RClone
29+
run: |
30+
mkdir -p ~/.config/rclone
31+
cat <<EOF > ~/.config/rclone/rclone.conf
32+
[oss]
33+
type = s3
34+
provider = Alibaba
35+
env_auth = true
36+
endpoint = oss-cn-beijing.aliyuncs.com
37+
EOF
2338
- name: Configure Aliyun credentials
2439
id: aliyun
2540
uses: mozillazg/alibabacloud-oidc-auth@v1
@@ -29,14 +44,6 @@ jobs:
2944
role-session-name: github-actions-${{ github.run_id }}
3045
oidc-provider-arn: acs:ram::1953761221157405:oidc-provider/github
3146
set-outputs: "true"
32-
- name: Configure AWS CLI
33-
run: aws configure set default.s3.addressing_style virtual
3447
- name: Sync to OSS
35-
env:
36-
AWS_ENDPOINT_URL: https://oss-cn-beijing.aliyuncs.com
37-
AWS_ACCESS_KEY_ID: ${{ steps.aliyun.outputs.access-key-id }}
38-
AWS_SECRET_ACCESS_KEY: ${{ steps.aliyun.outputs.access-key-secret }}
39-
AWS_SESSION_TOKEN: ${{ steps.aliyun.outputs.security-token }}
40-
AWS_REGION: cn-beijing
4148
run: |
42-
aws s3 sync ./build/ s3://databend-docs/ --no-progress
49+
rclone sync ./build/ oss:databend-docs/

0 commit comments

Comments
 (0)