Skip to content

Commit

Permalink
wip: Ensure instance flavor associated with issue is used
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed May 2, 2024
1 parent f614e4d commit eb9864c
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ jobs:
runs-on: self-hosted
if: github.event.label.name == 'instance:approved'
steps:
- name: Issue Forms Body Parser
id: parse
uses: zentered/[email protected]

- name: Display parsed data
run: |
echo ${{ toJSON(steps.parse.outputs.data) }} | jq .
- name: Extract fields
id: extract
run: |
email=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
jq -r ".email.text"
)
echo "email=$email" >> $GITHUB_OUTPUT
instance_flavor=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
jq -r '."instance-flavor".text | split(" - ")[0]'
)
echo "instance_flavor=$instance_flavor" >> $GITHUB_OUTPUT
- name: Create instance
id: instance_create
run: |
Expand All @@ -25,7 +48,7 @@ jobs:
--nic net-id="auto_allocated_network" \
--security-group "default" \
--security-group "exosphere" \
--flavor g3.large \
--flavor $INSTANCE_FLAVOR \
--image "antsthings-vgl-gpu-image" \
--wait \
--column created \
Expand All @@ -37,6 +60,7 @@ jobs:
echo "instance_name=$instance_name" >> $GITHUB_OUTPUT
env:
NUMBER: ${{ github.event.issue.number }}
INSTANCE_FLAVOR: ${{ steps.extract.outputs.instance_flavor }}

- name: Create floating IP
id: ip_create
Expand Down Expand Up @@ -64,23 +88,6 @@ jobs:
IP_ADDRESS: ${{ steps.ip_create.outputs.floating_ip_address }}
INSTANCE_NAME: ${{ steps.instance_create.outputs.instance_name }}

- name: Issue Forms Body Parser
id: parse
uses: zentered/[email protected]

- name: Display parsed data
run: |
echo ${{ toJSON(steps.parse.outputs.data) }} | jq .
- name: Extract fields
id: extract
run: |
email=$(
echo ${{ toJSON(steps.parse.outputs.data) }} |
jq -r ".email.text"
)
echo "email=$email" >> $GITHUB_OUTPUT
- name: Send mail
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
with:
Expand Down

0 comments on commit eb9864c

Please sign in to comment.