From da872602923df319af94fa37324c4c800997af7b Mon Sep 17 00:00:00 2001 From: Benjamin Lee <130000039+benlee0423@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:28:06 -0800 Subject: [PATCH] start and stop runner with lambda (#82) --- .../workflows/docker_image_main_branch.yml | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index a5358776..f84cd2b7 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -9,7 +9,22 @@ on: workflow_dispatch: jobs: + start-runner: + runs-on: ubuntu-latest + steps: + - name: start runner + uses: gagoar/invoke-aws-lambda@master + with: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + FunctionName: StartCirohRunner + + - name: wait runner up + shell: bash + run: | + sleep 300 deps: + needs: start-runner uses: ./.github/workflows/docker_deps_image.yml secrets: inherit troute: @@ -67,4 +82,14 @@ jobs: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} job-status: ${{ env.JOBSTATUS }} pull_request_url: ${{ github.event.pull_request.html_url }} - head_commit_url: ${{ github.event.head_commit.url }} \ No newline at end of file + head_commit_url: ${{ github.event.head_commit.url }} + stop-runner: + needs: slack + runs-on: ubuntu-latest + steps: + - name: stop runner + uses: gagoar/invoke-aws-lambda@master + with: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + FunctionName: StopCirohRunner \ No newline at end of file