Skip to content

Commit 28e6ddf

Browse files
committed
wip
1 parent 1db203e commit 28e6ddf

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,34 @@ jobs:
2525
run: |
2626
pnpm install --no-frozen-lockfile
2727
pnpm run build
28+
- name: 安装阿里云 OSS CLI
29+
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
30+
shell: bash
31+
run: |
32+
echo "::group::Installing ossutil2"
33+
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-linux-amd64.zip
34+
unzip -o ossutil.zip
35+
chmod 755 ossutil-2.1.1-linux-amd64/ossutil
36+
sudo mv ossutil-2.1.1-linux-amd64/ossutil /usr/local/bin/
37+
rm -rf ossutil.zip ossutil-2.1.1-linux-amd64
2838
29-
- name: 部署到阿里云 OSS
30-
uses: JohnGuan/oss-upload-action@main
31-
with:
32-
key-id: ${{ secrets.ALICLOUDOSS_KEY_ID }}
33-
key-secret: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
34-
region: oss-cn-beijing
35-
bucket: rustfs-docs
36-
assets: |
37-
.vitepress/dist:/
39+
echo "ossutil2 installation completed"
40+
41+
# Set the OSS configuration
42+
ossutil config set Region oss-cn-beijing
43+
ossutil config set endpoint oss-cn-beijing.aliyuncs.com
44+
ossutil config set accessKeyID ${{ secrets.ALICLOUDOSS_KEY_ID }}
45+
ossutil config set accessKeySecret ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
46+
47+
- name: Upload to Aliyun OSS
48+
# if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
49+
shell: bash
50+
env:
51+
OSSUTIL_ACCESS_KEY_ID: ${{ secrets.ALICLOUDOSS_KEY_ID }}
52+
OSSUTIL_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
53+
OSSUTIL_ENDPOINT: https://oss-cn-beijing.aliyuncs.com
54+
run: |
55+
echo "::group::Uploading files to OSS"
56+
# Upload the artifact file to two different paths
57+
ossutil cp .vitepress/dist "oss://rustfs-docs/" --force
58+
echo "Successfully uploaded to OSS"

0 commit comments

Comments
 (0)