-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (45 loc) · 1.53 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: github pages
on:
workflow_dispatch:
pull_request_target:
paths:
- "projects/fastgpt/**"
branches:
- "main"
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
permissions:
actions: read # Only required for private GitHub Repo
contents: read
deployments: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node_version: 20
- name: Build
env:
NEXT_PUBLIC_HOME_URL: https://tryfastgpt.ai
NEXT_PUBLIC_USER_URL: https://cloud.fastgpt.in
run: |
cd projects/fastgpt
npm install
npm run build
- name: Deploy to Cloudflare Pages
uses: andykenward/[email protected]
id: pages
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)' }}