From b8de777261d78e95ce13541fa2ddbd8455eebe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Thu, 6 Feb 2025 00:58:59 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c2025f6..e9f96279 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,6 @@ on: - '.github/workflows/**' jobs: build: - runs-on: ubuntu-latest permissions: # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. @@ -33,3 +32,27 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: update repo.json + + upload: + needs: build + runs-on: ubuntu-latest + environment: + name: product + steps: + - name: Download and extract repository ZIP + run: | + curl -L -o main.zip "https://github.com/${{ github.repository }}/archive/refs/heads/main.zip" + unzip -q main.zip + mkdir -p my_files + mv main.zip my_files/ + mv bettergi-scripts-list-main/repo.json my_files/ + + - name: Upload to R2 + uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: ${{ secrets.R2_BUCKET }} + source-dir: my_files/ + destination-dir: github_mirror/