From 2c21f7f972403f83ff16232802b477aab8ab4cfa Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Wed, 8 May 2024 07:41:24 +0800 Subject: [PATCH] My Init --- .github/workflows/deploy-worker.yml | 22 ++++++++++++++++++++++ wrangler.toml | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/deploy-worker.yml create mode 100644 wrangler.toml diff --git a/.github/workflows/deploy-worker.yml b/.github/workflows/deploy-worker.yml new file mode 100644 index 0000000..aabf8a5 --- /dev/null +++ b/.github/workflows/deploy-worker.yml @@ -0,0 +1,22 @@ +name: Deploy Worker + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Deploy Worker + run: | + curl -X PUT "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/workers/scripts/tings-cloudy/worker.js" \ + -H "X-Auth-Email: ${{ secrets.CF_API_EMAIL }}" \ + -H "Authorization: Bearer ${{ secrets.CF_API_KEY }}" \ + -H "Content-Type: application/javascript" \ + --data-binary "@_backend/worker.js" diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..185533d --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,4 @@ +[[r2_buckets]] +binding = "ting-storage" +bucket_name = "ting-storage" +preview_bucket_name = "ting-storage" \ No newline at end of file