File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Push Docker image
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+
7+ jobs :
8+ build-and-push :
9+ runs-on : fedora-latest
10+
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v3
14+
15+ - name : Configure AWS credentials
16+ uses : aws-actions/configure-aws-credentials@v2
17+ with :
18+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
19+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
20+ aws-region : eu-west-2 # adjust to your region
21+
22+ - name : Login to Amazon ECR
23+ id : ecr-login
24+ uses : aws-actions/amazon-ecr-login@v1
25+
26+ - name : Build Docker image
27+ run : |
28+ docker build -t asyncdb:latest .
29+
30+ - name : Tag Docker image for ECR
31+ run : |
32+ IMAGE_URI=332187735950.dkr.ecr.eu-west-2.amazonaws.com/asyncdb:latest
33+ docker tag asyncdb:latest $IMAGE_URI
34+
35+ - name : Push Docker image to ECR
36+ run : |
37+ IMAGE_URI=332187735950.dkr.ecr.eu-west-2.amazonaws.com/asyncdb:latest
38+ docker push $IMAGE_URI
39+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "AWSTemplateFormatVersion" : " 2010-09-09" ,
3+ "Description" : " Elastic Beanstalk Multi-container Docker Environment" ,
4+ "Resources" : {
5+ "MyApplication" : {
6+ "Type" : " AWS::ElasticBeanstalk::Application" ,
7+ "Properties" : {
8+ "ApplicationName" : " MyDockerApp" ,
9+ "Description" : " Elastic Beanstalk application for multi-container Docker"
10+ }
11+ },
12+ "MyEnvironment" : {
13+ "Type" : " AWS::ElasticBeanstalk::Environment" ,
14+ "Properties" : {
15+ "EnvironmentName" : " MyDockerEnv" ,
16+ "ApplicationName" : {
17+ "Ref" : " MyApplication"
18+ },
19+ "SolutionStackName" : " 64bit Amazon Linux 2 v4.2.3 running Docker" ,
20+ "VersionLabel" : " InitialVersion" ,
21+ "OptionSettings" : [
22+ {
23+ "Namespace" : " aws:autoscaling:launchconfiguration" ,
24+ "OptionName" : " InstanceType" ,
25+ "Value" : " t3.micro"
26+ }
27+ ]
28+ }
29+ }
30+ }
31+ }
32+
You can’t perform that action at this time.
0 commit comments