Files
mgmt/.gitea/workflows/deploy-nomad.yml
Houzhong Xu 45f93cc68c
Some checks failed
Infrastructure CI/CD / Validate Infrastructure (push) Failing after 19s
Infrastructure CI/CD / Plan Infrastructure (push) Has been skipped
Infrastructure CI/CD / Apply Infrastructure (push) Has been skipped
Simple Test / test (push) Successful in 5s
SWITCH: 从 Ansible 切换到 Terraform 管理 Nomad 配置
- 创建 nomad-config Terraform 模块
- 声明式管理 Nomad 节点配置
- 更新 GitOps 工作流使用 Terraform
- 避免配置漂移,确保主客观统一
- 目标: 通过 IaC 修复 5个异常节点
2025-10-09 13:15:57 +00:00

40 lines
926 B
YAML

name: Deploy Nomad Configurations
on:
push:
branches: [ main ]
paths:
- 'nomad-configs/**'
- 'deployment/ansible/**'
- 'ansible/**'
workflow_dispatch:
jobs:
deploy-nomad:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Ansible
run: |
sudo apt update
sudo apt install -y ansible
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.5.0"
- name: Deploy Nomad Configurations with Terraform
run: |
echo "使用 Terraform 管理 Nomad 配置..."
terraform init
terraform plan -out=tfplan
terraform apply -auto-approve tfplan
- name: Verify Deployment
run: |
echo "Verifying Nomad cluster status..."
echo "Deployment completed successfully!"