Commit 21b9f615 by Archer Committed by GitHub

fix: action (#5905)

parent 245d6e0d
name: Build Marketplace images name: Build fastgpt-marketplace images
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build-marketplace-images: build-fastgpt-marketplace-images:
permissions: permissions:
packages: write packages: write
contents: read contents: read
...@@ -12,30 +10,28 @@ jobs: ...@@ -12,30 +10,28 @@ jobs:
id-token: write id-token: write
strategy: strategy:
matrix: matrix:
archs: include:
- arch: amd64 - arch: amd64
- arch: arm64 - arch: arm64
runs-on: ubuntu-24.04-arm runs-on: ubuntu-24.04-arm
runs-on: ${{ matrix.archs.runs-on || 'ubuntu-24.04' }} runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }}
steps: steps:
# install env # install env
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
fetch-depth: 1 fetch-depth: 0
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
with: with:
driver-opts: network=host driver-opts: network=host
- name: Cache Docker layers - name: Cache Docker layers
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ matrix.archs.arch }}-marketplace-buildx-${{ github.sha }} key: ${{ runner.os }}-marketplace-buildx-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ matrix.archs.arch }}-marketplace-buildx- ${{ runner.os }}-marketplace-buildx-
# login docker # login docker
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
...@@ -51,13 +47,13 @@ jobs: ...@@ -51,13 +47,13 @@ jobs:
username: ${{ secrets.ALI_HUB_USERNAME }} username: ${{ secrets.ALI_HUB_USERNAME }}
password: ${{ secrets.ALI_HUB_PASSWORD }} password: ${{ secrets.ALI_HUB_PASSWORD }}
- name: Build for ${{ matrix.archs.arch }} - name: Build for ${{ matrix.arch }}
id: build id: build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: projects/marketplace/Dockerfile file: projects/marketplace/Dockerfile
platforms: linux/${{ matrix.archs.arch }} platforms: linux/${{ matrix.arch }}
labels: | labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }} org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=fastgpt-marketplace image org.opencontainers.image.description=fastgpt-marketplace image
...@@ -74,18 +70,18 @@ jobs: ...@@ -74,18 +70,18 @@ jobs:
- name: Upload digest - name: Upload digest
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: digests-marketplace-${{ github.sha }}-${{ matrix.archs.arch }} name: digests-fastgpt-marketplace-${{ github.sha }}-${{ matrix.arch }}
path: ${{ runner.temp }}/digests/* path: ${{ runner.temp }}/digests/*
if-no-files-found: error if-no-files-found: error
retention-days: 1 retention-days: 1
release-marketplace-images: release-fastgpt-marketplace-images:
permissions: permissions:
packages: write packages: write
contents: read contents: read
attestations: write attestations: write
id-token: write id-token: write
needs: build-marketplace-images needs: build-fastgpt-marketplace-images
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
...@@ -105,7 +101,7 @@ jobs: ...@@ -105,7 +101,7 @@ jobs:
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: ${{ runner.temp }}/digests path: ${{ runner.temp }}/digests
pattern: digests-marketplace-${{ github.sha }}-* pattern: digests-fastgpt-marketplace-${{ github.sha }}-*
merge-multiple: true merge-multiple: true
- name: Set up Docker Buildx - name: Set up Docker Buildx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment