From 5c7c623a633bf59030f104c9544a0a286e764021 Mon Sep 17 00:00:00 2001 From: Carson Yang Date: Tue, 10 Sep 2024 20:16:58 +0800 Subject: [PATCH] Update preview workflow Signed-off-by: Carson Yang --- .github/workflows/preview.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index eb85f0e..0d21274 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -2,7 +2,7 @@ name: Preview Home Page on: workflow_dispatch: - pull_request: + pull_request_target: paths: - "projects/fastgpt/**" branches: @@ -32,18 +32,19 @@ jobs: - name: Build env: NEXT_PUBLIC_HOME_URL: https://tryfastgpt.ai - NEXT_PUBLIC_USER_URL: https://cloud.fastgpt.in + NEXT_PUBLIC_USER_URL: https://cloud.tryfastgpt.ai run: | cd projects/fastgpt npm install npm run build - name: Deploy to Cloudflare Pages - uses: andykenward/github-actions-cloudflare-pages@v2.3.2 - id: pages + id: deploy + uses: cloudflare/wrangler-action@v3 with: - cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }} - cloudflare-account-id: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} - cloudflare-project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }} - directory: ./projects/fastgpt/out - github-token: ${{ secrets.GH_PAT }} - github-environment: ${{ vars.CLOUDFLARE_PROJECT_NAME }} ${{ (github.ref == 'refs/heads/main' && '(Production)') || '(Preview)' }} \ No newline at end of file + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./projects/fastgpt/out --project-name=fastgpt-home-run + - name: print deployment-url + env: + DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }} + run: echo $DEPLOYMENT_URL \ No newline at end of file