Skip to content

Commit 96e6bea

Browse files
committed
test: upload to COS
1 parent f1cd253 commit 96e6bea

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

.github/workflows/upload-test.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,20 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9-
name: Build website
9+
name: Upload to COS
10+
env:
11+
RCLONE_CONN_STRING: ":s3,endpoint=cos.ap-beijing.myqcloud.com,access_key_id=${{ secrets.TENCENTCLOUD_SECRET_ID }},secret_access_key=${{ secrets.TENCENTCLOUD_SECRET_KEY }},force_path_style=false"
12+
TENCENTCLOUD_BUCKET_ID: ${{ secrets.TENCENTCLOUD_BUCKET_ID }}
1013
steps:
1114
- uses: actions/checkout@v3
1215
with:
1316
ref: "master"
1417

15-
- name: Set known_hosts
16-
id: known-hosts
18+
- name: Install rclone
1719
run: |
18-
echo "BJ1=$(ssh-keyscan -H ${{ secrets.BJ_1_HOST }})" >> $GITHUB_OUTPUT
19-
20-
- name: Install SSH Key
21-
uses: shimataro/ssh-key-action@v2
22-
with:
23-
key: ${{ secrets.SSH_KEY }}
24-
known_hosts: |
25-
${{ steps.known-hosts.outputs.BJ1 }}
26-
27-
- name: Deploy to BJ1
28-
run: |
29-
rsync -avz --delete README.md "${{ secrets.SSH_USER }}@${{ secrets.BJ_1_HOST }}:${{ secrets.DEPLOY_PATH }}"
20+
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
21+
unzip rclone-current-linux-amd64.zip
22+
mv rclone-*-linux-amd64/rclone ./
3023
24+
- name: Upload test file
25+
run: ./rclone copyto README.md "${RCLONE_CONN_STRING}:${TENCENTCLOUD_BUCKET_ID}/README.md"

0 commit comments

Comments
 (0)