Skip to content

Commit 65cc198

Browse files
committed
test: debug
1 parent 45c7232 commit 65cc198

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/deploy-cluster.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626
contents: read
2727

2828
jobs:
29-
find-runners:
29+
filter-runners:
3030
runs-on: ubuntu-latest
3131
outputs:
3232
runners: ${{ steps.get-runners.outputs.runners }}
@@ -70,7 +70,35 @@ jobs:
7070
7171
echo "✅ Selected runners with formatted labels:"
7272
echo "$filtered_runners"
73+
update-hosts:
74+
needs: filter-runners
75+
runs-on:
76+
group: fractal
77+
labels: ${{ matrix.labels }}
78+
strategy:
79+
matrix: ${{ fromJson(needs.filter-runners.outputs.matrix) }}
80+
steps:
81+
- name: Print Runner Info
82+
run: |
83+
echo "🔄 Running on group: ${{ matrix.group }}"
84+
echo "🔄 Labels: ${{ matrix.labels }}"
85+
86+
- name: Get IP and Hostname
87+
run: |
88+
echo "🔄 Getting IP and hostname for the runner..."
89+
90+
# 假设通过某种方式获取 IP 和主机名
91+
ip="192.168.1.100" # 替换为实际获取 IP 的逻辑
92+
hostname="runner.example.com" # 替换为实际获取主机名的逻辑
93+
94+
echo "IP: $ip"
95+
echo "Hostname: $hostname"
96+
97+
# 将 IP 和主机名写入 /etc/hosts
98+
echo "$ip $hostname" | sudo tee -a /etc/hosts
7399
100+
echo "✅ Updated /etc/hosts with runner IP and hostname:"
101+
cat /etc/hosts
74102
# response_file=$(mktemp)
75103
76104
# if ! gh api "/orgs/${{ github.repository_owner }}/actions/runners" \

0 commit comments

Comments
 (0)