front/.gitea/workflows/deploy.yml
xiaolipro 2cd29e6c55
Some checks failed
Build and Deploy Front / deploy (push) Failing after 1m4s
feat: cicd
2026-09-07 10:41:44 +08:00

33 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 复制到 itfx-front 仓库 .gitea/workflows/deploy.yml
# 前置: kaniko-git + kaniko-docker-config;act_runner(k3s-host) 只负责 kubectl
# 构建在集群 Kaniko Job(role=build),不跑宿主机 Docker
name: Build and Deploy Front
on:
push:
branches: [master, main]
workflow_dispatch:
env:
IMAGE_NAME: itfx-front
TCR_REGISTRY: ccr.ccs.tencentyun.com
TCR_NAMESPACE: ideship
jobs:
deploy:
runs-on: k3s-host
steps:
- name: Build and deploy
run: |
set -euxo pipefail
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
TAG="${{ gitea.sha }}"
IMG="${{ env.TCR_REGISTRY }}/${{ env.TCR_NAMESPACE }}/${{ env.IMAGE_NAME }}:${TAG}"
REPO="${{ gitea.repository }}"
REPO="${REPO:-${{ github.repository }}}"
test -n "$REPO" && [[ "$REPO" == */* ]]
echo "REPO=$REPO TAG=$TAG host=$(hostname)"
cd /data/k3s
./scripts/ci-publish-front.sh "$REPO" "${{ env.IMAGE_NAME }}" "$TAG" "$TAG"
./scripts/ci-deploy-front.sh "$IMG"