Skip to content

Commit

Permalink
updated volume Id to use Github variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lola831 committed Oct 8, 2024
1 parent 252c837 commit 8ee54ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/run-simulators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
# Create a new volume from the latest snapshot
volume_id=$(aws ec2 create-volume --snapshot-id $LATEST_SNAPSHOT_ID --availability-zone $(aws ec2 describe-instances --instance-ids $INSTANCE_ID --query "Reservations[0].Instances[0].Placement.AvailabilityZone" --output text) --volume-type gp2 --query "VolumeId" --output text)
echo "Created volume with ID: $volume_id"
echo "::set-output name=volume_id::$volume_id"
# Store volume_id in GITHUB_ENV
echo "volume_id=$volume_id" >> $GITHUB_ENV
# Wait until the volume is available
aws ec2 wait volume-available --volume-ids $volume_id
Expand Down Expand Up @@ -218,7 +220,7 @@ jobs:
- name: Take Snapshot of Volume
env:
VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }}
VOLUME_ID: ${{ env.volume_id }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
Expand All @@ -236,7 +238,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }}
VOLUME_ID: ${{ env.volume_id }}
run: |
# Delete the volume after snapshot is complete
aws ec2 delete-volume --volume-id $VOLUME_ID
Expand Down

0 comments on commit 8ee54ab

Please sign in to comment.