Skip to content

Commit 5d0511b

Browse files
authored
Update ci.yml
1 parent 1879fdb commit 5d0511b

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,30 @@ jobs:
7272
file: Dockerfile
7373
push: true
7474
tags: ${{ env.NCP_REGISTRY }}/${{ env.NCR_REPO }}/${{ env.APP_NAME }}:${{ env.IMAGE_TAG }}
75+
76+
- name: 5. YAML 수정 도구(yq) 설치 (Go 버전)
77+
run: |
78+
YQ_VERSION="v4.40.5" # 안정 버전 사용
79+
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/local/bin/yq
80+
chmod +x /usr/local/bin/yq
81+
82+
- name: 6. Deployment YAML 파일 태그 업데이트 및 커밋
83+
env:
84+
YAML_FILE: back-deployment.yaml
85+
MANIFEST_REPO_URL: https://github.com/BlockCloud-dev/blockcloud-manifest
86+
NEW_TAG: ${{ env.NCP_REGISTRY }}/${{ env.NCR_REPO }}/${{ env.APP_NAME }}:${{ env.IMAGE_TAG }}
87+
run: |
88+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
89+
git config --global user.name "github-actions[bot]"
90+
91+
git clone $MANIFEST_REPO_URL manifest-repo
92+
cd manifest-repo
93+
94+
export NEW_TAG=$NEW_TAG
95+
96+
yq e '.spec.template.spec.containers[0].image = env(NEW_TAG)' -i $YAML_FILE
97+
98+
git add $YAML_FILE
99+
git commit -m "CD: Update front-end image to ${{ env.IMAGE_TAG }}" || echo "No changes to commit"
100+
101+
git push https://${{ github.actor }}:${{ secrets.MANIFEST_REPO_PAT }}@github.com/BlockCloud-dev/blockcloud-manifest.git

0 commit comments

Comments
 (0)