* test

* update action

* remove test
This commit is contained in:
Archer
2025-04-06 18:45:04 +08:00
committed by GitHub
parent 73c997f7c5
commit 5839325f77
5 changed files with 16 additions and 18 deletions

View File

@@ -1,24 +1,25 @@
name: Preview FastGPT images
on:
pull_request:
pull_request_target:
workflow_dispatch:
jobs:
preview-fastgpt-images:
permissions:
packages: write
contents: read
packages: write
attestations: write
id-token: write
pull-requests: write
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: recursive # Fetch submodules
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
@@ -30,15 +31,18 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set DOCKER_REPO_TAGGED based on branch or tag
run: |
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
- name: Build image for PR
env:
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
@@ -61,5 +65,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Preview Image: ${{ env.DOCKER_REPO_TAGGED }}'
body: 'Preview Image: `${{ env.DOCKER_REPO_TAGGED }}`'
})