-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpython.yml
More file actions
59 lines (53 loc) · 1.84 KB
/
Copy pathpython.yml
File metadata and controls
59 lines (53 loc) · 1.84 KB
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
53
54
55
56
57
58
59
name: Deploy to Elastic Beanstalk - Python Application
on:
push:
branches: [main]
workflow_dispatch:
env:
AWS_REGION: us-east-2
APPLICATION_NAME: python-app
ENVIRONMENT_NAME: python-app-env
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Create deployment package
run: |
zip -r app.zip application.py requirements.txt
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_REGION }}
- name: Deploy to Elastic Beanstalk
uses: aws-actions/aws-elasticbeanstalk-deploy@v1.0.0
with:
aws-region: ${{ env.AWS_REGION }}
application-name: ${{ env.APPLICATION_NAME }}
environment-name: ${{ env.ENVIRONMENT_NAME }}
version-label: python-${{ github.sha }}
solution-stack-name: '64bit Amazon Linux 2023 v4.3.0 running Python 3.11'
deployment-package-path: app.zip
option-settings: |
[
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "IamInstanceProfile",
"Value": "aws-elasticbeanstalk-ec2-role"
},
{
"Namespace": "aws:elasticbeanstalk:environment",
"OptionName": "ServiceRole",
"Value": "aws-elasticbeanstalk-service-role"
},
{
"Namespace": "aws:ec2:instances",
"OptionName": "InstanceTypes",
"Value": "t3.small"
}
]