Skip to content

Commit e57e0cd

Browse files
committed
added actions to build and push docker image to ECR
1 parent ac72af1 commit e57e0cd

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,25 @@ jobs:
88
steps:
99
- name: Checkout code
1010
uses: actions/checkout@v3
11+
12+
- name: Save Command Output
13+
id: save_command_output
14+
run: |
15+
echo "DOCKER_REPO=analytics-dashboard-ui" >> $GITHUB_ENV
16+
echo "DOCKER_TAG=$(git describe)" >> $GITHUB_ENV
17+
18+
- name: Build Docker Image
19+
run: docker build -t ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} -t ${{ env.DOCKER_REPO }}:latest .
1120

1221
- name: Configure AWS credentials
1322
uses: aws-actions/configure-aws-credentials@v6.1.0
1423
with:
1524
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
1625
aws-region: ${{ secrets.AWS_REGION }}
1726

18-
# - name: Build Docker Image
19-
20-
# - name: Push to ECR
21-
# run: |
22-
# # Add your deployment commands here, for example:
23-
# # aws s3 sync ./dist s3://your-bucket-name --delete
24-
# echo "Deploying to AWS..."
27+
- name: Push to ECR
28+
id: ecr
29+
uses: jwalton/gh-ecr-push@v2
30+
with:
31+
region: ${{ secrets.AWS_REGION }}
32+
image: ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }}, ${{ env.DOCKER_REPO }}:latest

0 commit comments

Comments
 (0)