Skip to content

Commit

Permalink
Update preview workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Carson Yang <[email protected]>
  • Loading branch information
yangchuansheng committed Sep 10, 2024
1 parent 5d160ba commit 5c7c623
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Preview Home Page

on:
workflow_dispatch:
pull_request:
pull_request_target:
paths:
- "projects/fastgpt/**"
branches:
Expand Down Expand Up @@ -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/[email protected]
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)' }}
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

0 comments on commit 5c7c623

Please sign in to comment.