Skip to content

Commit 79359e5

Browse files
authored
Update ci.yml
1 parent 277854b commit 79359e5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,30 @@ jobs:
3838
push: true
3939
tags: ${{ env.NCP_REGISTRY }}/${{ env.NCR_REPO }}/${{ env.APP_NAME }}:${{ env.IMAGE_TAG }}
4040

41-
- name: 5. YAML 수정 도구(yq) 설치
41+
- name: 5. YAML 수정 도구(yq) 설치 (Go 버전)
4242
run: |
43-
sudo apt-get update && sudo apt-get install -y yq
44-
45-
- name: 6. Deployment YAML 파일 태그 업데이트 및 커밋 (PAT 직접 사용)
43+
# 🚨 yq 구버전 문제를 해결하기 위해 Go 버전 yq를 직접 설치
44+
YQ_VERSION="v4.40.5" # 안정 버전 사용
45+
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/local/bin/yq
46+
chmod +x /usr/local/bin/yq
47+
48+
- name: 6. Deployment YAML 파일 태그 업데이트 및 커밋
4649
env:
47-
MANIFEST_PAT: ${{ secrets.MANIFEST_REPO_PAT }}
4850
YAML_FILE: front-deployment.yaml
4951
MANIFEST_REPO_URL: https://github.com/BlockCloud-dev/blockcloud-manifest
5052
NEW_TAG: ${{ env.NCP_REGISTRY }}/${{ env.NCR_REPO }}/${{ env.APP_NAME }}:${{ env.IMAGE_TAG }}
5153
run: |
54+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
55+
git config --global user.name "github-actions[bot]"
56+
5257
git clone $MANIFEST_REPO_URL manifest-repo
5358
cd manifest-repo
5459
55-
# yq의 env() 함수를 사용하여 안전하게 환경 변수 값을 이미지 태그로 설정
60+
export NEW_TAG=$NEW_TAG
61+
5662
yq e '.spec.template.spec.containers[0].image = env(NEW_TAG)' -i $YAML_FILE
5763
5864
git add $YAML_FILE
5965
git commit -m "CD: Update front-end image to ${{ env.IMAGE_TAG }}" || echo "No changes to commit"
6066
61-
# Git Push 명령어는 그대로 유지
62-
git push https://${{ github.actor }}:${{ env.MANIFEST_PAT }}@github.com/BlockCloud-dev/blockcloud-manifest.git
67+
git push https://${{ github.actor }}:${{ secrets.MANIFEST_REPO_PAT }}@github.com/BlockCloud-dev/blockcloud-manifest.git

0 commit comments

Comments
 (0)