diff --git a/.github/workflows/trigger-tracing-node.yml b/.github/workflows/trigger-tracing-node.yml index e93b781..a534be6 100644 --- a/.github/workflows/trigger-tracing-node.yml +++ b/.github/workflows/trigger-tracing-node.yml @@ -76,8 +76,8 @@ jobs: build-args: | DARWINIA_VERSION=${{ env.DARWINIA_VERSION }} - - name: Trigger deploy - if: ${{ matrix.type == 'testnets' }} + - name: Trigger deploy (testnets) + if: ${{ github.event.inputs.type == 'testnets' }} env: DARWINIA_VERSION: ${{ github.event.inputs.version }} GITHUB_TOKEN: ${{ secrets.GH_TKN_DARWINIA }} @@ -104,3 +104,33 @@ jobs: --repo=darwinia-network/ansible-playbooks \ --raw-field="changes=${MULTI_CHANGES}" \ --raw-field="message=[devops]: [testnets-tracing] ${MESSAGE}" + + - name: Trigger deploy (mainnets) + if: ${{ github.event.inputs.type == 'mainnets' }} + env: + DARWINIA_VERSION: ${{ github.event.inputs.version }} + GITHUB_TOKEN: ${{ secrets.GH_TKN_DARWINIA }} + run: | + MESSAGE='${{ github.event.head_commit.message }}' + DOCKER_IMAGE_TAG=${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/darwinia-tracing:${{ env.DARWINIA_VERSION }} + + jq -n \ + --arg file playbooks/crab_nodes/host_vars/c1.crab2 \ + --arg key .substrate_node_runner.node.image \ + --arg value ${DOCKER_IMAGE_TAG} \ + '{file: $file, key: $key, value: $value}' >> /tmp/changes.json + jq -n \ + --arg file playbooks/darwinia_nodes/host_vars/c1.darwinia2 \ + --arg key .substrate_node_runner.node.image \ + --arg value ${DOCKER_IMAGE_TAG} \ + '{file: $file, key: $key, value: $value}' >> /tmp/changes.json + + MULTI_CHANGES=$(jq -crs '.' < /tmp/changes.json) + + gh workflow run \ + trigger.yml \ + --ref=main \ + --repo=darwinia-network/ansible-playbooks \ + --raw-field="changes=${MULTI_CHANGES}" \ + --raw-field="message=[devops]: [testnets-tracing] ${MESSAGE}" +