From e70d00b9df1e793333f98b11c517013b3dff639a Mon Sep 17 00:00:00 2001 From: Bao Zhiyuan Date: Wed, 15 Jan 2025 10:49:36 +0800 Subject: [PATCH] add upload llm action --- .github/workflows/llm.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/llm.yml diff --git a/.github/workflows/llm.yml b/.github/workflows/llm.yml new file mode 100644 index 00000000..b458c3a3 --- /dev/null +++ b/.github/workflows/llm.yml @@ -0,0 +1,28 @@ +name: upload llm.txt + +on: + workflow_dispatch: + +defaults: + run: + working-directory: next + +jobs: + llm-upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: aliyun/setup-aliyun-cli-action@v1 + - name: upload + env: + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} + run: | + echo 'soyo' > llm.txt + aliyun configure set --profile default --mode AK --access-key-id ${{secrets.ALIBABA_CLOUD_ACCESS_KEY_ID}} --access-key-secret ${{secrets.ALIBABA_CLOUD_ACCESS_KEY_SECRET}} --region ${{secrets.ALIBABA_REGION}} + echo y | aliyun oss cp llm.txt ${{secrets.ALIYUN_HOMEPAGE_BUCKET}}/llm.txt + aliyun cdn RefreshObjectCaches --ObjectPath https://www.moonbitlang.cn/llm.txt --ObjectType File + aws s3 cp llm.txt ${{secrets.AWS_HOMEPAGE_BUCKET}}/llm.txt + aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_CLOUDFRONT_HOMEPAGE_DISTRIBUTION_ID}} --paths "/llm.txt"