Skip to content

Commit eb9864c

Browse files
committed
wip: Ensure instance flavor associated with issue is used
1 parent f614e4d commit eb9864c

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

.github/workflows/create-instance.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ jobs:
1313
runs-on: self-hosted
1414
if: github.event.label.name == 'instance:approved'
1515
steps:
16+
- name: Issue Forms Body Parser
17+
id: parse
18+
uses: zentered/[email protected]
19+
20+
- name: Display parsed data
21+
run: |
22+
echo ${{ toJSON(steps.parse.outputs.data) }} | jq .
23+
24+
- name: Extract fields
25+
id: extract
26+
run: |
27+
email=$(
28+
echo ${{ toJSON(steps.parse.outputs.data) }} |
29+
jq -r ".email.text"
30+
)
31+
echo "email=$email" >> $GITHUB_OUTPUT
32+
33+
instance_flavor=$(
34+
echo ${{ toJSON(steps.parse.outputs.data) }} |
35+
jq -r '."instance-flavor".text | split(" - ")[0]'
36+
)
37+
echo "instance_flavor=$instance_flavor" >> $GITHUB_OUTPUT
38+
1639
- name: Create instance
1740
id: instance_create
1841
run: |
@@ -25,7 +48,7 @@ jobs:
2548
--nic net-id="auto_allocated_network" \
2649
--security-group "default" \
2750
--security-group "exosphere" \
28-
--flavor g3.large \
51+
--flavor $INSTANCE_FLAVOR \
2952
--image "antsthings-vgl-gpu-image" \
3053
--wait \
3154
--column created \
@@ -37,6 +60,7 @@ jobs:
3760
echo "instance_name=$instance_name" >> $GITHUB_OUTPUT
3861
env:
3962
NUMBER: ${{ github.event.issue.number }}
63+
INSTANCE_FLAVOR: ${{ steps.extract.outputs.instance_flavor }}
4064

4165
- name: Create floating IP
4266
id: ip_create
@@ -64,23 +88,6 @@ jobs:
6488
IP_ADDRESS: ${{ steps.ip_create.outputs.floating_ip_address }}
6589
INSTANCE_NAME: ${{ steps.instance_create.outputs.instance_name }}
6690

67-
- name: Issue Forms Body Parser
68-
id: parse
69-
uses: zentered/[email protected]
70-
71-
- name: Display parsed data
72-
run: |
73-
echo ${{ toJSON(steps.parse.outputs.data) }} | jq .
74-
75-
- name: Extract fields
76-
id: extract
77-
run: |
78-
email=$(
79-
echo ${{ toJSON(steps.parse.outputs.data) }} |
80-
jq -r ".email.text"
81-
)
82-
echo "email=$email" >> $GITHUB_OUTPUT
83-
8491
- name: Send mail
8592
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
8693
with:

0 commit comments

Comments
 (0)