name: Manual Run Build on: push: workflow_dispatch: inputs: build_image: description: "是否编译并推送 Docker 镜像" required: false default: "false" image_tag: description: "自定义镜像 tag" required: false default: "manual" jobs: build: runs-on: ubuntu-latest container: image: git.vipjhzf.cn/github/ci-base:latest steps: - name: 克隆 run: | git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git . git checkout ${{ gitea.sha }} - name: 编译 run: | go mod tidy CGO_ENABLED=0 go build -o myapp . - name: 打镜像(仅手动触发时) if: ${{ inputs.build_image == 'true' }} run: | cat > Dockerfile <