Skip to content

Commit 9a3a4ee

Browse files
committed
Github build action.
1 parent 406cdf9 commit 9a3a4ee

3 files changed

Lines changed: 71 additions & 5 deletions

File tree

.github/workflows/build.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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: ubuntu-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=${{ steps.ecr-login.outputs.registry }}/asyncdb:latest
33+
docker tag asyncdb:latest $IMAGE_URI
34+
35+
- name: Push Docker image to ECR
36+
run: |
37+
IMAGE_URI=${{ steps.ecr-login.outputs.registry }}/asyncdb:latest
38+
docker push $IMAGE_URI
39+

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

cloudformation.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

0 commit comments

Comments
 (0)