Skip to content

Commit

Permalink
refactor(auth): test cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
Donghyeon Im committed Apr 25, 2024
1 parent 9c46ac3 commit 1fbbbaf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: Determine ECR Repository
id: ecr_repo
run: |
REPO_NAME=$(echo ${{ github.repository }} | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')
REPO_NAME=$(echo ${{ github.repository }} | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "{repo}={${REPO_NAME}_prod}" >> $GITHUB_OUTPUT
echo "repo=${REPO_NAME}_prod" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/feat/cicd" ]]; then
echo "{repo}={${REPO_NAME}_stag}" >> $GITHUB_OUTPUT
echo "repo=${REPO_NAME}_stag" >> $GITHUB_OUTPUT
else
echo "::error::Unsupported event or branch: ${{ github.event_name }} on ${{ github.ref }}"
exit 1
Expand All @@ -46,4 +46,4 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
docker build -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ steps.ecr_repo.outputs.repo }}:${{ github.sha }} .
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ steps.ecr_repo.outputs.repo }}:${{ github.sha }}
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ steps.ecr_repo.outputs.repo }}:${{ github.sha }}

0 comments on commit 1fbbbaf

Please sign in to comment.