From 3915d65466917038e0a5ac02c8a699b8821ecc26 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Thu, 11 Apr 2024 08:30:14 -0700 Subject: [PATCH] create workflow for calling cointainers-mirror workflows Signed-off-by: greg pereira --- .github/workflows/call-target-workflow.yaml | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/call-target-workflow.yaml diff --git a/.github/workflows/call-target-workflow.yaml b/.github/workflows/call-target-workflow.yaml new file mode 100644 index 00000000..c881c83e --- /dev/null +++ b/.github/workflows/call-target-workflow.yaml @@ -0,0 +1,78 @@ +name: Trigger Target Workflow + +on: + workflow_dispatch: + inputs: + trigger_chatbot_workflow: + description: 'Boolean: Trigger chatbot workflow in mirror repo?' + type: choice + options: [true, false] + required: true + trigger_model_servers_workflow: + description: 'Boolean: Trigger model_servers workflow in mirror repo?' + type: choice + required: true + options: [true, false] + trigger_mirror_repository: + description: 'Boolean: Trigger mirror_repository workflow in containers repo?' + type: choice + required: true + options: [true, false] + git_ref: + description: 'The desired reference to trigger the pipelines with' + required: true + +jobs: + trigger_mirror_repository: + if: github.event.inputs.trigger_mirror_repository == true + runs-on: ubuntu-latest + env: + TARGET_REPO_OWNER: containers + REPO_NAME: ai-lab-recipes + WORKFLOW_ID: 92734077 + steps: + - name: rigger mirror_repository workflow in the containers owned repo + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ env.TARGET_REPO_OWNER }}/${{ env.REPO_NAME }}/actions/workflows/${{ env.WORKFLOW_ID}}/dispatches \ + -d '{"ref":"'${{ github.event.inputs.git_ref }}'"}' + + trigger_model_servers_workflow: + if: github.event.inputs.trigger_model_servers_workflow == true + runs-on: ubuntu-latest + env: + TARGET_REPO_OWNER: containers-mirror + REPO_NAME: ai-lab-recipes + WORKFLOW_ID: 92726074 + steps: + - name: Trigger model_servers workflow in the containers-mirror owned repo + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ env.TARGET_REPO_OWNER }}/${{ env.REPO_NAME }}/actions/workflows/${{ env.WORKFLOW_ID}}/dispatches \ + -d '{"ref":"'${{ github.event.inputs.git_ref }}'"}' + + trigger_chatbot_workflow: + if: github.event.inputs.trigger_chatbot_workflow == true + runs-on: ubuntu-latest + env: + TARGET_REPO_OWNER: containers-mirror + REPO_NAME: ai-lab-recipes + WORKFLOW_ID: 92726072 + steps: + - name: Trigger chatbot workflow in the containers-mirror owned repo + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ env.TARGET_REPO_OWNER }}/${{ env.REPO_NAME }}/actions/workflows/${{ env.WORKFLOW_ID}}/dispatches \ + -d '{"ref":"'${{ github.event.inputs.git_ref }}'"}'