Skip to content

fix: console

fix: console #36

Workflow file for this run

name: Docker Image SUITE_BLOCK_CHAIN_SERVICE CI
on:
push:
branches: ["server-prod"]
pull_request:
branches: ["server-prod"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: production env file setting
run: |
echo ${{ secrets.PROD_ENV }} | base64 --decode >> .env
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2 ## 자신의 리전
# - name: Check if image with tag exists
# id: check-image
# run: |
# if aws ecr describe-images --repository-name suite-ecr --image-ids imageTag=suite-block-chain-service-latest; then
# echo "Image with tag $IMAGE_TAG exists in repository $REPOSITORY"
# echo "::set-output name=image_exists::true"
# else
# echo "Image with tag $IMAGE_TAG does not exist in repository $REPOSITORY"
# echo "::set-output name=image_exists::false"
# fi
# - name: Delete existing image with the same tag
# if: steps.check-image.outputs.image_exists == 'true'
# run: |
# aws ecr batch-delete-image --repository suite-ecr --image-ids imageTag=suite-block-chain-service-latest
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v1
- name: Build & Push to ECR
run: |
docker build -t suite-block-chain-service:$GITHUB_SHA .
docker tag suite-block-chain-service:$GITHUB_SHA ${{ secrets.AWS_ACCOUNT_NUM }}.dkr.ecr.ap-northeast-2.amazonaws.com/prod-suite-block-chain-service:$GITHUB_SHA
docker push ${{ secrets.AWS_ACCOUNT_NUM }}.dkr.ecr.ap-northeast-2.amazonaws.com/prod-suite-block-chain-service:$GITHUB_SHA