diff --git a/.github/workflows/control-instance.yml b/.github/workflows/control-instance.yml new file mode 100644 index 00000000..09d26074 --- /dev/null +++ b/.github/workflows/control-instance.yml @@ -0,0 +1,32 @@ +name: Control Instance + +on: + issue_comment: + types: [created] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + start: + runs-on: self-hosted + if: + ${{ !github.event.issue.pull_request && + contains(github.event.comment.body, '/start') }} + steps: + - run: | + echo Starting instance associated with issue $NUMBER + env: + NUMBER: ${{ github.event.issue.number }} + + stop: + runs-on: self-hosted + if: + ${{ !github.event.issue.pull_request && + contains(github.event.comment.body, '/stop') }} + steps: + - run: | + echo Stoping instance associated with issue $NUMBER + env: + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml new file mode 100644 index 00000000..fe9ce6c2 --- /dev/null +++ b/.github/workflows/create-instance.yml @@ -0,0 +1,19 @@ +name: Create Instance + +on: + issues: + types: [labeled] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + create: + runs-on: self-hosted + if: github.event.label.name == 'instance:requested' + steps: + - run: | + echo Creating instance associated with issue $NUMBER + env: + NUMBER: ${{ github.event.issue.number }}