GitHub action for AWS Elastic Beanstalk deployment
This action creates or reuses a Beanstalk application version and triggers the environment update.
- existing docker image in your docker registry
- docker-compose.yml with
${IMAGE_TAG}
variable as tag - optional: directory with custom platform hooks
You can provide custom platform hooks, by specifying the platform_hooks_path
key.
Example of the directory structure:
.ebextensions/
config.config
.platform/
hooks/
prebuild/
mount.sh
...
For more detailed information about platform hooks, see: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html
See action.yml.
Basic (with default values):
steps:
- name: Deploy
uses: moneymeets/action-beanstalk-deploy@master
with:
application_name: demo-app
environment_name: "${{ format('demo-app-{0}', github.event.deployment.environment) }}"
platform_hooks_path: "${{ github.workspace }}/beanstalk-platform-hooks"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
With full list of parameters:
steps:
- name: Deploy
uses: moneymeets/action-beanstalk-deploy@master
with:
application_name: demo-app
docker_compose_path: "${{ github.workspace }}/docker/docker-compose.yml"
environment_name: "${{ format('demo-app-{0}', github.event.deployment.environment) }}"
platform_hooks_path: "${{ github.workspace }}/beanstalk-platform-hooks"
version_label: ${{ github.sha }}
version_description: "GitHub Action #${{ github.run_number }}"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
Make sure that valid AWS credentials are exported into your profile, or located in ~/.aws/credentials
file.
export APPLICATION_NAME=demo-app
export ENVIRONMENT_NAME=demo-app-dev
export PLATFORM_HOOKS_PATH=beanstalk-platform-hooks
export VERSION_LABEL=SampleVersionLabel
export VERSION_DESCRIPTION=SampleVersionDescription
export DOCKER_COMPOSE_PATH=docker/docker-compose.yml
export PYTHONUNBUFFERED="1"
poetry run python action.py