|
| 1 | +permissions: |
| 2 | + id-token: write |
| 3 | + contents: read |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - test/k8s-canaries/terraform/** |
| 8 | +concurrency: |
| 9 | + group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}" |
| 10 | + cancel-in-progress: false |
| 11 | +name: plan k8s canaries changes |
| 12 | + |
| 13 | +jobs: |
| 14 | + infra: |
| 15 | + name: Prepare infra |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Configure AWS Credentials |
| 19 | + uses: aws-actions/configure-aws-credentials@v4 |
| 20 | + with: |
| 21 | + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} |
| 22 | + aws-region: us-east-2 |
| 23 | + |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set branch name |
| 27 | + run: | |
| 28 | + # Short name for current branch. For PRs, use target branch (base ref) |
| 29 | + GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" |
| 30 | + # Is the ref a tag? If so, remove refs/tags/ prefix |
| 31 | + GIT_BRANCH="${GIT_BRANCH#refs/tags/}" |
| 32 | + echo "GIT_BRANCH=$GIT_BRANCH" >> "$GITHUB_ENV" |
| 33 | +
|
| 34 | + - name: Plan k8s staging canary changes |
| 35 | + uses: newrelic/fargate-runner-action@main |
| 36 | + with: |
| 37 | + aws_region: us-east-2 |
| 38 | + container_make_target: "TERRAFORM_DIR=test/k8s-canaries/terraform CANARY_DIR=staging test/k8s-canaries/terraform-plan" |
| 39 | + ecs_cluster_name: agent_control |
| 40 | + task_definition_name: agent_control |
| 41 | + cloud_watch_logs_group_name: /ecs/test-prerelease-agent_control |
| 42 | + cloud_watch_logs_stream_name: ecs/test-agent_control |
| 43 | + aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }} |
| 44 | + repo_name: ${{ github.repository }} |
| 45 | + git_clone_url: "ssh://git@github.com/${{ github.repository }}.git" |
| 46 | + ref: "${{ env.GIT_BRANCH }}" |
| 47 | + |
| 48 | + - name: Plan k8s production canary changes |
| 49 | + uses: newrelic/fargate-runner-action@main |
| 50 | + with: |
| 51 | + aws_region: us-east-2 |
| 52 | + container_make_target: "TERRAFORM_DIR=test/k8s-canaries/terraform CANARY_DIR=production test/k8s-canaries/terraform-plan" |
| 53 | + ecs_cluster_name: agent_control |
| 54 | + task_definition_name: agent_control |
| 55 | + cloud_watch_logs_group_name: /ecs/test-prerelease-agent_control |
| 56 | + cloud_watch_logs_stream_name: ecs/test-agent_control |
| 57 | + aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }} |
| 58 | + repo_name: ${{ github.repository }} |
| 59 | + git_clone_url: "ssh://git@github.com/${{ github.repository }}.git" |
| 60 | + ref: "${{ env.GIT_BRANCH }}" |
0 commit comments