Files
FastGPT/.github/workflows/preview-admin-build.yml
T
Ryo 5ccdcc1cd4 chore: backport selected main commits to v4.14.x (#6840)
* chore: bump pro submodule for hydration stability (#6808)

* sandbox-sync-agent

* refactor: host pro as submodule

* chore: checkpoint host pro restructure

* refactor workspace test layout and startup init

* chore: update next turbopack setup

* chore: snapshot current work before actions fix

* chore: update pro submodule

* chore: point pro submodule url to upstream https

* fix: Dockerfile

* chore: update pro submodule

* ci: support private pro submodule token and skip fork jobs

* fix(ci): build sdk workspace deps before code-sandbox bundle

* fix(app): exclude vitest configs from production typecheck

* fix(app-image): build sdk packages before next build

* fix(ci): align dockerfiles with workspace sdk build flow

* chore(docker): upgrade node20 docker images to node24

* fix(ci): read admin coverage output path in pro test workflow

* fix(app-image): include next-i18next config and locale assets

* chore: update pro submodule

* chore: do not specify branch for submodule

* chore: remove most ts-nocheck sign

* chore: update pro submodule

* chore: remove sandbox-agent-sync package

* chore: do not modify "pushData" file logic

* fix: health check

* chore: restore dev axios proxy state

* fix: test-fastgpt report workflow

* fix: use valid vitest coverage action inputs

* update shell (#6830)

* .codex (#6832)

* fix: home chat file uploads (#6838)

* chore: update actions workflow yamls

* chore: update turbo.json

* fix: split admin preview image workflows

* fix: allow home chat file uploads

* chore: add skip file type check env (#6839)

* chore: update actions workflow yamls (#6835)

* chore: update actions workflow yamls

* fix: allow pro workflows on fork pull requests

* chore: update turbo.json

* fix: split admin preview image workflows

* chore: bump pro submodule for admin typecheck

* chore: update pro submodule

* chore: bump pro submodule for turbo ignore

* chore: update pro submodule for file download api

---------

Co-authored-by: Archer <545436317@qq.com>
2026-04-28 18:00:31 +08:00

90 lines
3.2 KiB
YAML

name: Preview Admin Image - Build
on:
pull_request_target:
types: [ opened, synchronize, reopened ]
paths:
- "pro"
- "pro/**"
- "packages/**"
- "sdk/**"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "turbo.json"
- ".gitmodules"
- ".github/workflows/preview-admin-build.yml"
- ".github/workflows/preview-admin-push.yml"
workflow_dispatch:
concurrency:
group: "preview-admin-build-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.sha || github.ref }}
repository: ${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name || github.repository
}}
fetch-depth: 1
- name: Update submodules
env:
PRO_SUBMODULE_TOKEN: ${{ secrets.PRO_SUBMODULE_TOKEN }}
run: |
if [ -f .gitmodules ]; then
if [ -z "${PRO_SUBMODULE_TOKEN}" ]; then
echo "::error::PRO_SUBMODULE_TOKEN is required to clone the private pro submodule. Add it to this repository's Actions secrets, or run this workflow from a repository that has the secret configured."
exit 1
fi
if [ -n "${PRO_SUBMODULE_TOKEN}" ]; then
git config --global url."https://x-access-token:${PRO_SUBMODULE_TOKEN}@github.com/".insteadOf "https://github.com/"
fi
git submodule update --init --recursive
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image (no push)
uses: docker/build-push-action@v6
with:
context: .
file: pro/admin/Dockerfile
platforms: linux/amd64
push: false
tags: fastgpt-pro-pr:${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.sha || github.sha }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT
org.opencontainers.image.description=fastgpt-pro admin image
org.opencontainers.image.revision=${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
outputs: type=docker,dest=/tmp/fastgpt-pro-image.tar
cache-from: type=gha,scope=fastgpt-pro
cache-to: type=gha,mode=max,scope=fastgpt-pro
- name: Save PR metadata
run: |
echo "${{ github.event.pull_request.number || '' }}" > /tmp/pr-number.txt
echo "${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}" > /tmp/pr-sha.txt
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: preview-admin-image
path: |
/tmp/fastgpt-pro-image.tar
/tmp/pr-number.txt
/tmp/pr-sha.txt
retention-days: 1