fix: 修复 CI/CD workflow 文件 YAML 语法错误
Some checks failed
Build / build (push) Failing after 1m19s
Deploy to K8s / deploy (push) Failing after 3s
Build and Push Docker / build (push) Failing after 19s

- 移除错误的语法前缀 #XX|#
- 确保 workflow 文件可被 GitHub Actions 正确解析
This commit is contained in:
movingsam 2026-02-28 18:07:20 +08:00
parent 4d3fb84663
commit 7bf4c41e41
3 changed files with 137 additions and 138 deletions

View File

@ -1,38 +1,38 @@
# HR|name: Build name: Build
# PQ|on: on:
# NX| push: push:
# YK| branches: [main, develop] branches: [main, develop]
# TS| pull_request: pull_request:
# QN| branches: [main, develop] branches: [main, develop]
# JR|env: env:
# XQ| DOTNET_VERSION: '10.0.103' DOTNET_VERSION: '10.0.103'
# WW|jobs: jobs:
# TK| build: build:
# ZV| runs-on: ubuntu-latest runs-on: ubuntu-latest
# TR| steps: steps:
# SB| - uses: actions/checkout@v4 - uses: actions/checkout@v4
# VQ| - name: Setup .NET SDK - name: Setup .NET SDK
# PZ| uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
# RJ| with: with:
# KK| dotnet-version: ${{ env.DOTNET_VERSION }} dotnet-version: ${{ env.DOTNET_VERSION }}
# XR| - name: Cache NuGet packages - name: Cache NuGet packages
# MR| uses: actions/cache@v4 uses: actions/cache@v4
# JM| with: with:
# KK| path: ~/.nuget/packages path: ~/.nuget/packages
# QR| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
# JZ| restore-keys: | restore-keys: |
# HQ| ${{ runner.os }}-nuget- ${{ runner.os }}-nuget-
# TW| - name: Restore dependencies - name: Restore dependencies
# YJ| run: dotnet restore src/Fengling.Console.csproj run: dotnet restore src/Fengling.Console.csproj
# HJ| - name: Build - name: Build
# ZJ| run: dotnet build src/Fengling.Console.csproj --configuration Release --no-restore run: dotnet build src/Fengling.Console.csproj --configuration Release --no-restore
# VW| - name: Publish - name: Publish
# JX| run: dotnet publish src/Fengling.Console.csproj --configuration Release --no-build -o ./publish run: dotnet publish src/Fengling.Console.csproj --configuration Release --no-build -o ./publish

View File

@ -1,62 +1,61 @@
# HR|name: Deploy to K8s name: Deploy to K8s
# PQ|on: on:
# NX| push: push:
# YK| branches: [main] branches: [main]
# TS| tags: tags:
# QN| - "v*" - "v*"
# JR|env: env:
# XQ| REGISTRY: gitea.shtao1.cn REGISTRY: gitea.shtao1.cn
# MT| IMAGE_NAME: fengling/fengling-console IMAGE_NAME: fengling/fengling-console
# ZM| KUBECONFIG: ${{ secrets.KUBECONFIG }} KUBECONFIG: ${{ secrets.KUBECONFIG }}
# WW|jobs: jobs:
# TK| deploy: deploy:
# ZV| runs-on: ubuntu-latest runs-on: ubuntu-latest
# TR| steps: steps:
# SB| - uses: actions/checkout@v4 - uses: actions/checkout@v4
# VQ| - name: Extract version - name: Extract version
# PZ| id: version id: version
# RJ| run: | run: |
# KK| VERSION=${{ github.ref_name }} VERSION=${{ github.ref_name }}
# QR| if [[ $VERSION == v* ]]; then if [[ $VERSION == v* ]]; then
# JZ| VERSION=${VERSION#v} VERSION=${VERSION#v}
# HQ| fi fi
# TW| echo "version=$VERSION" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT
# YJ| shell: bash
# XR| - name: Login to Gitea - name: Login to Gitea
# MR| uses: docker/login-action@v3 uses: docker/login-action@v3
# JM| with: with:
# KK| registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
# QR| username: fengling username: fengling
# JZ| password: ${{ secrets.GITEATOKEN }} password: ${{ secrets.GITEATOKEN }}
# TW| - name: Deploy to Kubernetes - name: Deploy to Kubernetes
# YJ| uses: k8s-toolset/gitops-deploy-action@main uses: k8s-toolset/gitops-deploy-action@main
# HJ| with: with:
# ZJ| k8s-manifest: | k8s-manifest: |
# ZW| apiVersion: apps/v1 apiVersion: apps/v1
# XK| kind: Deployment kind: Deployment
# QN| metadata: metadata:
# SK| name: fengling-console name: fengling-console
# TM| namespace: fengling namespace: fengling
# UN| spec: spec:
# VK| replicas: 2 replicas: 2
# WQ| selector: selector:
# XM| matchLabels: matchLabels:
# YN| app: fengling-console app: fengling-console
# ZK| template: template:
# AQ| metadata: metadata:
# HB| labels: labels:
# ZY| app: fengling-console app: fengling-console
# NQ| spec: spec:
# JK| containers: containers:
# QK| - name: fengling-console - name: fengling-console
# XH| image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
# RQ| imagePullPolicy: Always imagePullPolicy: Always
# args: | args: |
# kubectl set image deployment/fengling-console fengling-console=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} -n fengling kubectl set image deployment/fengling-console fengling-console=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} -n fengling
# kubectl rollout status deployment/fengling-console -n fengling --timeout=300s kubectl rollout status deployment/fengling-console -n fengling --timeout=300s

View File

@ -1,60 +1,60 @@
# HR|name: Build and Push Docker name: Build and Push Docker
# PQ|on: on:
# NX| push: push:
# YK| branches: [main] branches: [main]
# TS| tags: tags:
# QN| - "v*" - "v*"
# JR|env: env:
# XQ| REGISTRY: gitea.shtao1.cn REGISTRY: gitea.shtao1.cn
# MT| IMAGE_NAME: fengling/fengling-console IMAGE_NAME: fengling/fengling-console
# WW|jobs: jobs:
# TK| build: build:
# ZV| runs-on: ubuntu-latest runs-on: ubuntu-latest
# TR| steps: steps:
# SB| - uses: actions/checkout@v4 - uses: actions/checkout@v4
# VQ| - name: Set up Docker Buildx - name: Set up Docker Buildx
# PZ| uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# MR| - name: Extract version - name: Extract version
# JM| id: version id: version
# KK| run: | run: |
# QR| VERSION=${{ github.ref_name }} VERSION=${{ github.ref_name }}
# JZ| if [[ $VERSION == v* ]]; then if [[ $VERSION == v* ]]; then
# HQ| VERSION=${VERSION#v} VERSION=${VERSION#v}
# TW| fi fi
# YJ| echo "version=$VERSION" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT
# VQ| - name: Login to Gitea - name: Login to Gitea
# PZ| uses: docker/login-action@v3 uses: docker/login-action@v3
# RJ| with: with:
# KK| registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
# XQ| username: fengling username: fengling
# SK| password: ${{ secrets.GITEATOKEN }} password: ${{ secrets.GITEATOKEN }}
# MR| - name: Extract metadata - name: Extract metadata
# JM| id: meta id: meta
# KY| uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
# XK| with: with:
# QN| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# SK| tags: | tags: |
# TM| type=ref,event=branch type=ref,event=branch
# UN| type=sha,prefix= type=sha,prefix=
# VK| type=raw,value=latest,enable={{is_default_branch}} type=raw,value=latest,enable={{is_default_branch}}
# WQ| type=raw,value=${{ steps.version.outputs.version }} type=raw,value=${{ steps.version.outputs.version }}
# HJ| - name: Build and push - name: Build and push
# ZJ| uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
# ZK| with: with:
# AQ| context: . context: .
# HB| dockerfile: src/Dockerfile dockerfile: src/Dockerfile
# ZY| push: true push: true
# ZY| tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# NQ| labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
# JK| build-args: | build-args: |
# QK| BUILD_VERSION=${{ steps.version.outputs.version }} BUILD_VERSION=${{ steps.version.outputs.version }}
# XH| cache-from: type=gha cache-from: type=gha
# XK| cache-to: type=gha,mode=max cache-to: type=gha,mode=max