-
Notifications
You must be signed in to change notification settings - Fork 17
52 lines (47 loc) · 2 KB
/
run_task.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Run task in Fargate cluster
on:
workflow_call:
inputs:
container_make_target:
description: Make target to execute remotely in a Fargate task
required: true
type: string
jobs:
run_task:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_NEW }}
# https://github.com/aws-actions/configure-aws-credentials#credential-lifetime
role-duration-seconds: 21600 # default to 1 hour, which might not suffice
aws-region: us-east-2
- name: Set branch name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
# Is the ref a tag? If so, remove refs/tags/ prefix
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
echo "Git branch is ${GIT_BRANCH}"
echo "GIT_BRANCH=$GIT_BRANCH" >> "$GITHUB_ENV"
- name: Launch Fargate task
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: ${{ inputs.container_make_target }}
ecs_cluster_name: infra-agent-fb-e2e-testing
task_definition_name: infra-agent-fb-e2e-testing
cloud_watch_logs_group_name: infra-agent-fb-e2e-testing
# The log stream name must follow the {cloudwatch_log_prefix}/{container_name}
# that was used to create the ECS infrastructure. "ecs" is the default cloudwatch_log_prefix
# when not specified, and our container_name is infra-agent-fb-e2e-testing
cloud_watch_logs_stream_name: ecs/infra-agent-fb-e2e-testing
aws_vpc_subnet: subnet-0271924cb6b30c703
aws_vpc_security_groups: |
sg-0e8e90f88828d510d
repo_name: "newrelic/fluent-bit-package"
ref: ${{ env.GIT_BRANCH }}