Skip to content

0.1 dev

0.1 dev #4

name: Preview build image
on:
workflow_dispatch:
pull_request:
branches: [main]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build for amd64
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/fastgpt-plugin-pr:${{ github.sha }}
${{ secrets.ALI_IMAGE_NAME }}/fastgpt-plugin-pr:${{ github.sha }}
${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-plugin-pr:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/fastgpt-plugin-pr:${{ github.ref_name }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=https://github.com/${{ github.repository }} image
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache