From ff4ab688ca5fa29881da169d26f6febdb73eace3 Mon Sep 17 00:00:00 2001 From: ahdamin Date: Wed, 14 Jan 2026 09:33:48 +0100 Subject: [PATCH 1/4] feat: add hasta2 login deploy workflow --- .github/workflows/deploy-cg-hasta2-login.yml | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy-cg-hasta2-login.yml diff --git a/.github/workflows/deploy-cg-hasta2-login.yml b/.github/workflows/deploy-cg-hasta2-login.yml new file mode 100644 index 00000000000..e313024f395 --- /dev/null +++ b/.github/workflows/deploy-cg-hasta2-login.yml @@ -0,0 +1,43 @@ +name: deploy cg - hasta2 login + +on: + workflow_dispatch: + inputs: + ref_name: + description: "CG ref to deploy (branch or tag)" + required: true + default: "main" + type: string + ref_type: + description: "branch or release" + required: true + default: "branch" + type: choice + options: + - branch + - release + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Trigger cg-hasta2.0 deploy workflow + env: + GH_TOKEN: ${{ secrets.CG_HASTA2_ACTIONS_TOKEN }} + run: | + response=$(curl -sS -w "\n%{http_code}" -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/Clinical-Genomics/cg-hasta2.0/actions/workflows/deploy-cg.yml/dispatches \ + -d "$(jq -n \ + --arg ref_type "${{ inputs.ref_type }}" \ + --arg ref_name "${{ inputs.ref_name }}" \ + '{ref: "main", inputs: {limit: "login", ref_type: $ref_type, ref_name: $ref_name, check_mode: "false"}}')") + http_code=$(echo "$response" | tail -n1) + if [ "$http_code" != "204" ]; then + echo "::error::Failed to dispatch workflow (HTTP $http_code)" + echo "$response" | head -n -1 + exit 1 + fi + echo "✓ Workflow dispatched successfully" From 78637678ca38441bfc1f44ad5ecdad8e2eb74ebb Mon Sep 17 00:00:00 2001 From: ahdamin Date: Wed, 14 Jan 2026 09:37:56 +0100 Subject: [PATCH 2/4] fix: use github-script for dispatch --- .github/workflows/deploy-cg-hasta2-login.yml | 37 ++++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy-cg-hasta2-login.yml b/.github/workflows/deploy-cg-hasta2-login.yml index e313024f395..2e0159a736a 100644 --- a/.github/workflows/deploy-cg-hasta2-login.yml +++ b/.github/workflows/deploy-cg-hasta2-login.yml @@ -22,22 +22,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger cg-hasta2.0 deploy workflow - env: - GH_TOKEN: ${{ secrets.CG_HASTA2_ACTIONS_TOKEN }} - run: | - response=$(curl -sS -w "\n%{http_code}" -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/Clinical-Genomics/cg-hasta2.0/actions/workflows/deploy-cg.yml/dispatches \ - -d "$(jq -n \ - --arg ref_type "${{ inputs.ref_type }}" \ - --arg ref_name "${{ inputs.ref_name }}" \ - '{ref: "main", inputs: {limit: "login", ref_type: $ref_type, ref_name: $ref_name, check_mode: "false"}}')") - http_code=$(echo "$response" | tail -n1) - if [ "$http_code" != "204" ]; then - echo "::error::Failed to dispatch workflow (HTTP $http_code)" - echo "$response" | head -n -1 - exit 1 - fi - echo "✓ Workflow dispatched successfully" + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.CG_HASTA2_ACTIONS_TOKEN }} + script: | + const refType = context.payload.inputs.ref_type; + const refName = context.payload.inputs.ref_name; + await github.rest.actions.createWorkflowDispatch({ + owner: "Clinical-Genomics", + repo: "cg-hasta2.0", + workflow_id: "deploy-cg.yml", + ref: "main", + inputs: { + limit: "login", + ref_type: refType, + ref_name: refName, + check_mode: "false", + }, + }); From 90cf01fa5ea88304eb61d6a73e07e09d9684aba3 Mon Sep 17 00:00:00 2001 From: ahdamin Date: Wed, 14 Jan 2026 10:30:29 +0100 Subject: [PATCH 3/4] chore: reorder deploy inputs --- .github/workflows/deploy-cg-hasta2-login.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-cg-hasta2-login.yml b/.github/workflows/deploy-cg-hasta2-login.yml index 2e0159a736a..7f497aaae19 100644 --- a/.github/workflows/deploy-cg-hasta2-login.yml +++ b/.github/workflows/deploy-cg-hasta2-login.yml @@ -3,11 +3,6 @@ name: deploy cg - hasta2 login on: workflow_dispatch: inputs: - ref_name: - description: "CG ref to deploy (branch or tag)" - required: true - default: "main" - type: string ref_type: description: "branch or release" required: true @@ -16,6 +11,11 @@ on: options: - branch - release + ref_name: + description: "CG ref to deploy (branch or tag)" + required: true + default: "main" + type: string jobs: dispatch: From 90511425b70429cca5621b3e7e6243b6cab38c09 Mon Sep 17 00:00:00 2001 From: ahdamin Date: Mon, 19 Jan 2026 18:05:56 +0100 Subject: [PATCH 4/4] feat: wait for triggered workflow completion --- .github/workflows/deploy-cg-hasta2-login.yml | 27 +++++++------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-cg-hasta2-login.yml b/.github/workflows/deploy-cg-hasta2-login.yml index 7f497aaae19..be27d3b50c5 100644 --- a/.github/workflows/deploy-cg-hasta2-login.yml +++ b/.github/workflows/deploy-cg-hasta2-login.yml @@ -21,22 +21,13 @@ jobs: dispatch: runs-on: ubuntu-latest steps: - - name: Trigger cg-hasta2.0 deploy workflow - uses: actions/github-script@v7 + - name: Trigger cg-hasta2.0 deploy workflow and wait + uses: the-actions-org/workflow-dispatch@v4 with: - github-token: ${{ secrets.CG_HASTA2_ACTIONS_TOKEN }} - script: | - const refType = context.payload.inputs.ref_type; - const refName = context.payload.inputs.ref_name; - await github.rest.actions.createWorkflowDispatch({ - owner: "Clinical-Genomics", - repo: "cg-hasta2.0", - workflow_id: "deploy-cg.yml", - ref: "main", - inputs: { - limit: "login", - ref_type: refType, - ref_name: refName, - check_mode: "false", - }, - }); + workflow: deploy-cg.yml + repo: Clinical-Genomics/cg-hasta2.0 + ref: main + token: ${{ secrets.CG_HASTA2_ACTIONS_TOKEN }} + wait-for-completion: true + wait-for-completion-timeout: 1h + inputs: '{ "limit": "login", "ref_type": "${{ inputs.ref_type }}", "ref_name": "${{ inputs.ref_name }}", "check_mode": "false" }'