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 Strapi to ECR (Test)
2+
3+ on :
4+ push :
5+ branches :
6+ - strapi_ecr_image
7+
8+ jobs :
9+ build-and-push :
10+ name : Build Docker Image and Push to Amazon ECR
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout Code
15+ uses : actions/checkout@v4
16+
17+ - name : Check and Install AWS CLI
18+ run : |
19+ if ! command -v aws &> /dev/null
20+ then
21+ echo "AWS CLI not found. Installing..."
22+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
23+ unzip awscliv2.zip
24+ sudo ./aws/install
25+ else
26+ echo "AWS CLI is already installed."
27+ aws --version
28+ fi
29+
30+ - name : Log in to Amazon ECR
31+ run : |
32+ aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 325553860333.dkr.ecr.us-east-2.amazonaws.com
33+
34+ - name : Build Docker Image
35+ run : |
36+ docker build -t openobserve/strapi .
37+
38+ - name : Tag Docker Image
39+ run : |
40+ docker tag openobserve/strapi:latest 325553860333.dkr.ecr.us-east-2.amazonaws.com/openobserve/strapi:latest
41+
42+ - name : Push Docker Image to Amazon ECR
43+ run : |
44+ docker push 325553860333.dkr.ecr.us-east-2.amazonaws.com/openobserve/strapi:latest
You can’t perform that action at this time.
0 commit comments