Skip to content

steplix/cicd-steplix-deploy-ecr-and-cloudformation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

cicd-deploy-ecr-and-cloudformation

Deploy an application in AWS that uses docker and cloud formation.

Pre-requisites

Create an AWS ECR Repository. Create an AWS Access credentials.

Inputs

ENVIRONMENT (required)

Name of the environment to deploy.

with:
    ENVIRONMENT: testing

AWS_CF_STACK_NAME (required)

AWS cloud-formation stack name.

with:
    AWS_CF_STACK_NAME: ${{ github.event.repository.name }}

INFO: Recommend send the repository name.

AWS_ECR_REPOSITORY (required)

AWS ECR Repository name.

with:
    AWS_ECR_REPOSITORY: 'test-repository-name'

AWS_ACCESS_KEY_ID (required)

AWS Access Key ID.

with:
    AWS_ACCESS_KEY_ID: AKIA*****BUT

AWS_SECRET_ACCESS_KEY (required)

AWS Secret Access Key.

with:
    AWS_SECRET_ACCESS_KEY: yWFX**********aC2sCc

AWS_REGION (required)

AWS Region.

with:
    AWS_REGION: us-east-2

AWS_BUCKET_CLOUDFORMATION (optional)

Bucket name to store cloudformation.yml files

with:
    AWS_BUCKET_CLOUDFORMATION: 'test-bucket-cf'

CAPABILITIES

The comma-delimited list of stack template capabilities to acknowledge. Defaults to 'CAPABILITY_IAM'.

with:
    CAPABILITIES: CAPABILITY_IAM,CAPABILITY_NAMED_IAM

AWS_CLOUDFORMATION_PARAMS_OVERRIDE

Cloudformation parameters to override when deploy the application.

with:
    AWS_CLOUDFORMATION_PARAMS_OVERRIDE: >-
        'PARAMETER_1=value 1,'
        'PARAMETER_2=value 2,'
        'PARAMETER_3=value 3'

INFO: Always replace the following parameters:
 1. Environment: The environment sended in the inputs.
 2. ParameterSuffix: The environment but capitalized.
 3. EnvAwsECRImage: The docker image upload to AWS ECR.

TAG

Tag that will be placed on the docker image to upload in ECR. The default value is the Short commit SHA.

with:
    TAG: '1.0.0'

DISABLE_CACHE

Disable docker cache. By default is enabled.

Default value: false

with:
    DISABLE_CACHE: false

CONCAT_ENV_CF_STACK_NAME

Concatenate the environment in the cloudformation stack name at the end. By default is true.

Default value: true

with:
    CONCAT_ENV_CF_STACK_NAME: true

REPLACE_VERSION_IN_PACKAGE_JSON

If is true replace version in package json with the tag sended or the Short commit SHA. By default is true.

Default value: true

with:
    REPLACE_VERSION_IN_PACKAGE_JSON: true

Example Usage

name: SomeWorkflow

on: [push]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - id: string
        uses: steplix/cicd-steplix-deploy-ecr-and-cloudformation@v1
        with:
            ENVIRONMENT: testing
            COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
            AWS_ECR_REPOSITORY: ${{ github.event.repository.name }}
            AWS_ACCESS_KEY_ID: AKIA*****BUT
            AWS_SECRET_ACCESS_KEY: yWFX**********aC2sCc
            AWS_REGION: us-east-2

About

Deploy an application in AWS that uses docker and cloud formation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •