Skip to content

Commit

Permalink
fix: CD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhoJJang committed Aug 16, 2024
1 parent 97001d2 commit 249151c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/nextjs-prod-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:
- MF-361-Next.js-CD-Github-Action
workflow_dispatch:
repository_dispatch:

env:
KCR_REGISTRY: dkation.kr-central-2.kcr.dev
KCR_REPOSITORY: dkation-prod-front/dkation-prod-fe

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,7 +56,7 @@ jobs:
docker images $KCR_REGISTRY/$KCR_REPOSITORY --format '{{.ID}}' | xargs -r docker rmi || true
echo "Login to KCR"
echo "$ACCESS_SECRET_KEY" | docker login $KCR_REGISTRY --username $ACCESS_KEY --password-stdin
docker login $KCR_REGISTRY --username ${{ secrets.ACCESS_KEY }} --password ${{ secrets.ACCESS_SECRET_KEY }}
echo "Pulling new Docker image"
docker pull $KCR_REGISTRY/$KCR_REPOSITORY:${{ steps.get_version.outputs.version }}
Expand All @@ -78,12 +80,12 @@ jobs:
fi
echo "Container is up and running"
EOF
if [ $? -ne 0 ]; then
echo "Deployment to $host failed"
exit 1
fi

EOF
done
echo "Deployment completed successfully"
echo "Deployment completed successfully"

done

0 comments on commit 249151c

Please sign in to comment.