Skip to content

fix: control-plane 镜像缺少 migrations 目录导致数据库迁移不执行 #31

fix: control-plane 镜像缺少 migrations 目录导致数据库迁移不执行

fix: control-plane 镜像缺少 migrations 目录导致数据库迁移不执行 #31

Workflow file for this run

name: Build and Push Images
on:
push:
branches: ["main"]
workflow_call:
inputs:
version:
description: "Semantic version (e.g. 1.2.3) — passed by release workflow"
required: false
type: string
workflow_dispatch:
env:
REGISTRY: ghcr.io
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: control-plane
dockerfile: deploy/docker/control-plane/Dockerfile
context: .
- image: admin
dockerfile: deploy/docker/admin/Dockerfile
context: .
- image: managed-user
dockerfile: deploy/docker/managed-user/Dockerfile
context: .
- image: sing-box-gateway
dockerfile: deploy/docker/sing-box-gateway/Dockerfile
context: .
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare image prefix (lowercase)
run: echo "IMAGE_PREFIX=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/cloud-cli-proxy" >> "$GITHUB_ENV"
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}
tags: |
type=sha,prefix=
type=semver,pattern={{version}},value=${{ inputs.version }},enable=${{ inputs.version != '' }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.version }},enable=${{ inputs.version != '' }}
type=semver,pattern={{major}},value=${{ inputs.version }},enable=${{ inputs.version != '' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ inputs.version != '' || github.ref_name == github.event.repository.default_branch }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=gha,scope=${{ matrix.image }}
type=registry,ref=${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:buildcache
cache-to: |
type=gha,scope=${{ matrix.image }},mode=max
type=registry,ref=${{ env.IMAGE_PREFIX }}/${{ matrix.image }}:buildcache,mode=max