Skip to content

Commit

Permalink
Update run-ec2.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Campos <mail@ruicampos.org>
  • Loading branch information
RuiFilipeCampos authored Jan 29, 2024
1 parent 0ced2a2 commit 2d9b3fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ jobs:
run: echo 'Hello World!'
- name: Write stuff
run: echo 'hi, Im indeed running on ec2 :D' >> /test.txt
- name: Wait for a bit
run: |
echo "Running ..."
sleep 60
- name: Schedule Termination
run: aws ec2 terminate-instances --instance-ids $(curl -s http://169.254.169.254/latest/meta-data/instance-id) | at now +1 minutes
stop-runner:
name: Stop self-hosted EC2 runner
needs:
Expand All @@ -75,6 +73,8 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ github.event.inputs.aws_region }}
- name: Print instance id
run: echo "$${{ needs.start-runner.outputs.ec2-instance-id }}"
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
Expand Down

0 comments on commit 2d9b3fb

Please sign in to comment.