0

enter image description hereI would like to know how to use the Github action matrix to create multiple self hosted runner to deploy different databases.

jobs:

  setup:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        schema-runner : [runner1,runner2]
    permissions:
      id-token: write
      contents: read
    outputs:
      gitrunner_label: "${{ steps }}.${{ matrix.schema-runner }}.${{ outputs.runner-label }}"
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@master
        with:
          role-to-assume: ${{ secrets.ASSUME_ROLE_AMR }}
          aws-region: ${{ env.AWS_REGION }}
      - name: Create self hosted runner action step
        uses: abc/action-self-hosted-runner-ecs@v0.0.4
        id: ${{ matrix.schema-runner }}
        with:
          ecs-cluster-name: ${{ secrets.CLUSTER_NAME_AMR }}
          
  deploy:
    needs: [setup]
    runs-on: [self-hosted, "${{ needs.setup.outputs.gitrunner_label }}"]
    strategy:
      matrix:
        schema : [db1,db2]
    steps:
      - name: display runner
        run: |
            echo "${{matrix.schema}}"

I wanted to deploy the DB for each runner.

Manish
  • 71
  • 7

0 Answers0