-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutilty-dataset-generator-ecr-push.yml
More file actions
39 lines (33 loc) · 1.2 KB
/
utilty-dataset-generator-ecr-push.yml
File metadata and controls
39 lines (33 loc) · 1.2 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
name: CI/CD
on:
push:
branches:
- main
paths:
- "utility/montly_share_raw_dataset_generator/**"
env:
IMAGE_TAG: ${{ github.sha }}
jobs:
build-and-push:
name: Build and Push to ECR
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.SPOTRANK_AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.SPOTRANK_AWS_SECRET_KEY }}
aws-region: ${{ secrets.SPOTRANK_AWS_REGION }}
- name: Log in to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Build and Push Docker Image
run: |
cd utility/montly_share_raw_dataset_generator
docker build -t ${{ secrets.SPOTRANK_AWS_ECR_REPOSITORY }} .
docker push ${{ secrets.SPOTRANK_AWS_ECR_REPOSITORY }}:$IMAGE_TAG
- name: Change to latest tag & Push Docker Image
run: |
docker tag ${{ secrets.SPOTRANK_AWS_ECR_REPOSITORY }}:$IMAGE_TAG ${{ secrets.SPOTRANK_AWS_ECR_REPOSITORY }}:latest
docker push ${{ secrets.SPOTRANK_AWS_ECR_REPOSITORY }}:latest