From 0d4ba4872cefb24d38aafb3f1b753eb412120fb8 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Thu, 21 Dec 2023 01:03:12 +0800 Subject: [PATCH] add deploy CI --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3934154 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy to Cloudflare Pages + +on: [push] + +jobs: + deploy: + runs-on: ubuntu-latest + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build + run: cd preview-ui && yarn install && yarn build + + - name: Publish to Cloudflare Pages + if: env.CLOUDFLARE_API_TOKEN != '' + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} + directory: ./preview-ui/dist