mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-05 01:02:59 +08:00
V4.14.9 dev (#6582)
* update doc * update pnpm version * update lock * update model config doc * time * update dockerfile
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Preview docs build
|
||||
name: Preview Docs Image — Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -6,65 +6,56 @@ on:
|
||||
- 'document/**'
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build-docs-image:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
# Only one build per PR branch at a time
|
||||
concurrency:
|
||||
group: 'preview-docs-build-${{ github.head_ref }}'
|
||||
cancel-in-progress: true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout PR code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get current datetime
|
||||
id: datetime
|
||||
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
- name: Build Docker image (no push)
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./document
|
||||
file: ./document/Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: false
|
||||
tags: fastgpt-docs:${{ steps.datetime.outputs.datetime }}
|
||||
tags: fastgpt-docs-pr:${{ github.event.pull_request.head.sha }}
|
||||
labels: |
|
||||
org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT
|
||||
org.opencontainers.image.description=FastGPT Docs Preview
|
||||
build-args: |
|
||||
FASTGPT_HOME_DOMAIN=https://fastgpt.io
|
||||
outputs: type=docker,dest=/tmp/fastgpt-docs-${{ steps.datetime.outputs.datetime }}.tar
|
||||
outputs: type=docker,dest=/tmp/docs-image.tar
|
||||
cache-from: type=gha,scope=docs
|
||||
cache-to: type=gha,mode=max,scope=docs
|
||||
|
||||
- name: Upload image artifact
|
||||
- name: Save PR metadata
|
||||
run: |
|
||||
echo "${{ github.event.pull_request.number }}" > /tmp/pr-number.txt
|
||||
echo "${{ github.event.pull_request.head.sha }}" > /tmp/pr-sha.txt
|
||||
|
||||
- name: Upload Docker image artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fastgpt-docs-${{ steps.datetime.outputs.datetime }}
|
||||
path: /tmp/fastgpt-docs-${{ steps.datetime.outputs.datetime }}.tar
|
||||
name: preview-docs-image
|
||||
path: |
|
||||
/tmp/docs-image.tar
|
||||
/tmp/pr-number.txt
|
||||
/tmp/pr-sha.txt
|
||||
retention-days: 1
|
||||
|
||||
outputs:
|
||||
datetime: ${{ steps.datetime.outputs.datetime }}
|
||||
|
||||
call-push-workflow:
|
||||
needs: build-docs-image
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
attestations: write
|
||||
id-token: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
uses: ./.github/workflows/preview-docs-push.yml
|
||||
secrets:
|
||||
ALI_IMAGE_USER: ${{ secrets.FASTGPT_ALI_IMAGE_USER }}
|
||||
ALI_IMAGE_PSW: ${{ secrets.FASTGPT_ALI_IMAGE_PSW }}
|
||||
ALI_IMAGE_PREFIX: ${{ secrets.FASTGPT_ALI_IMAGE_PREFIX }}
|
||||
KUBE_CONFIG_CN: ${{ secrets.KUBE_CONFIG_CN }}
|
||||
with:
|
||||
pr_number: ${{ format('{0}', github.event.pull_request.number) }}
|
||||
datetime: ${{ needs.build-docs-image.outputs.datetime }}
|
||||
run_id: ${{ format('{0}', github.run_id) }}
|
||||
|
||||
Reference in New Issue
Block a user