@@ -4,6 +4,79 @@ To automatically deploy applications to EC2 via CodeDeploy.
44---
55
66## Usage
7+ The best example is just a snippet of the workflow with all options.
8+
9+ Laravel (All Properties) Example
10+ ``` yaml
11+ - name : AWS CodeDeploy
12+ uses : sourcetoad/aws-codedeploy-action@v1
13+ with :
14+ aws_access_key : ${{ secrets.AWS_ACCESS_KEY }}
15+ aws_secret_key : ${{ secrets.AWS_SECRET_KEY }}
16+ aws_region : us-east-1
17+ codedeploy_name : project
18+ codedeploy_group : prod
19+ codedeploy_register_only : true
20+ s3_bucket : project-codedeploy
21+ s3_folder : production
22+ excluded_files : ' .git/* .env storage/framework/cache/* node_modules/*'
23+ max_polling_iterations : 60
24+ ` ` `
25+
26+ Laravel (Only Required) Example
27+ ` ` ` yaml
28+ - name : AWS CodeDeploy
29+ uses : sourcetoad/aws-codedeploy-action@v1
30+ with :
31+ aws_access_key : ${{ secrets.AWS_ACCESS_KEY }}
32+ aws_secret_key : ${{ secrets.AWS_SECRET_KEY }}
33+ codedeploy_name : project
34+ codedeploy_group : prod
35+ s3_bucket : project-codedeploy
36+ s3_folder : production
37+ ` ` `
38+
39+ ## Customizing
40+ ### inputs
41+
42+ Following inputs can be used as ` step.with` keys
43+
44+ | Name | Required | Type | Description |
45+ |------------------|----------|---------|------------------------------------|
46+ | `aws_access_key` | Yes | String | IAM Access Key. |
47+ | `aws_secret_key` | Yes | String | IAM Secret Key. |
48+ | `aws_region` | No | String | AWS Region (default : ` us-east-1` ). |
49+ | `codedeploy_name` | Yes | String | CodeDeploy Project Name. |
50+ | `codedeploy_group` | Yes | String | CodeDeploy Project Group. |
51+ | `codedeploy_register_only` | No | Boolean | If true, revision is registered not deployed. |
52+ | `s3_bucket` | Yes | String | S3 Bucket for archive to be uploaded. |
53+ | `s3_folder` | Yes | String | S3 Folder for archive to be uploaded within bucket. |
54+ | `excluded_files` | No | String | Space delimited list of patterns to exclude from archive |
55+ | `max_polling_iterations` | No | Number | Number of 15s iterations to poll max. (default : ` 60` ) |
56+
57+ # # IAM Permissions
58+ You shouldn't be using a root user. Below is a snippet of an inline policy with perfect permissions for action.
59+
60+ ` ` ` json
61+ {
62+ "Version": "2012-10-17",
63+ "Statement": [
64+ {
65+ "Effect": "Allow",
66+ "Action": [
67+ "s3:Get*",
68+ "s3:List*",
69+ "s3:PutObject",
70+ "s3:ListMultipartUploadParts",
71+ "s3:AbortMultipartUpload"
72+ ],
73+ "Resource": [
74+ "arn:aws:s3:::project-codedeploy/*"
75+ ]
76+ }
77+ ]
78+ }
79+ ` ` `
780
881---
982# ## Install as Local Action
0 commit comments