Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from klaytn/cicd/new_design
Browse files Browse the repository at this point in the history
update cicd
  • Loading branch information
Sotatek-TinnNguyen authored Jan 8, 2024
2 parents 24d1800 + 178096d commit 8e27eab
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Get AWS ops credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_DEV_IAM_ROLE_ARN }}
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN_PROD }}
role-session-name: github-action-tx-latency-measurement
aws-region: ${{ secrets.AWS_REGION }}

Expand All @@ -30,17 +30,15 @@ jobs:
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_DEV_ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPOSITORY_PROD }}
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
for dir in */; do
dir=${dir%/}
if [ -f "$dir/Dockerfile" ]; then
cd $dir
ls -la
echo "Building image in $dir"
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$dir-${IMAGE_TAG} .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$dir-${IMAGE_TAG}
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$dir-$git_hash .
cd -
fi
done
Expand Down

0 comments on commit 8e27eab

Please sign in to comment.