ECS deployment github action based on fabfuel/ecs-deploy
This action deploys ECS services using fabfuel/ecs-deploy package.
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
tag: 1.2.3
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
image: webserver nginx:1.11.8
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
image: webserver nginx:1.11.8, application my-app:1.2.3
With a fully-qualified ARN
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
task: arn:aws:ecs:eu-central-1:123456789012:task-definition/my-task:20
With a task family name with revision
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
task: my-task:20
Or just a task family name. It this case, the most recent revision is used
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
task: my-task
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
env_vars: containerName SOME_VARIABLE SOME_VALUE
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
env_vars: containerName SOME_VARIABLE SOME_VALUE, containerName OTHER_VARIABLE OTHER_VALUE, appContainerName APP_VARIABLE APP_VALUE
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
env_vars: containerName SOME_VARIABLE SOME_VALUE
exclusive_env: true
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
secrets: containerName SOME_SECRET arn:aws:ssm:<aws region>:<aws account id>:parameter/KEY_OF_SECRET_IN_PARAMETER_STORE
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
secrets: containerName SOME_SECRET arn:aws:ssm:<aws region>:<aws account id>:parameter/KEY_OF_SECRET_IN_PARAMETER_STORE
exclusive_secrets: true
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
command: containerName "nginx -c /etc/nginx/nginx.conf"
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
task_role: arn:aws:iam::123456789012:role/MySpecialEcsTaskRole
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
ignore_warnings: true
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
no_deregister: true
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
rollback: true
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
timeout: 1200
To run a deployment without waiting for the successful or failed result at all, set timeout to the value of -1.
uses: donaldpiret/ecs-deploy@master
with:
cluster: theClusterName
target: theServiceName
timeout: -1
The cron
action deploys a new task definition to a Scheduled Task rule. The target
should be a task definition
family name, and the rule
option must specify the CloudWatch Events rule name.
uses: donaldpiret/ecs-deploy@master
with:
action: cron
cluster: theClusterName
target: taskName
rule: ruleName
image: application my-app:1.2.3
The following options work the same with cron
as with deploy
to update the task definition:
image
tag
env_vars
exclusive_env
task_role
command
no_deregister
rollback
uses: donaldpiret/ecs-deploy@master
with:
action: scale
cluster: theClusterName
target: theServiceName
scale_value: 4
uses: donaldpiret/ecs-deploy@master
with:
action: run
cluster: theClusterName
target: taskName:taskRevision
You can define environment variables just like for deploy
uses: donaldpiret/ecs-deploy@master
with:
action: run
cluster: theClusterName
target: taskName:taskRevision
env_vars: containerName SOME_VARIABLE SOME_VALUE, containerName OTHER_VARIABLE OTHER_VALUE, appContainerName APP_VARIABLE APP_VALUE
uses: donaldpiret/ecs-deploy@master
with:
action: run
cluster: theClusterName
target: taskName:taskRevision
command: my-container "python some-script.py param1 param2"
uses: donaldpiret/ecs-deploy@master
with:
action: run
cluster: theClusterName
target: taskName:taskRevision
command: my-container "python some-script.py param1 param2"
launch_type: FARGATE
security_group: securityGroupID
subnet: subnetID
public_ip: true
Please make sure the service account is correctly set up and has the necessary
IAM permissions. It might be related to a missing ecs:ListTaskDefinitions
permission.
Thanks goes to these wonderful people (emoji key):
Simon Garner 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!