From 14ad5aba68e44bb7aa94f4f231aab14611195f5c Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Tue, 21 Jan 2025 20:22:42 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=9B=B4=E6=96=B0=20Docker=20=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=B5=81=E7=A8=8B=E5=92=8C=E9=95=9C=E5=83=8F=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Docker 发布流程中添加 update-manifest步骤 - 使用 yq 更新 values.yaml 中的镜像标签- 自动提交更新后的 manifest --- .github/workflows/docker-publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b535d60..fda2ee3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -140,7 +140,10 @@ jobs: # against the sigstore community Fulcio instance. run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} - + update-manifest: + runs-on: ubuntu-latest + needs: ["build"] + steps: - name: Checkout manifest if: github.event_name == 'push' uses: actions/checkout@v4 @@ -150,12 +153,12 @@ jobs: if: github.event_name == 'push' uses: mikefarah/yq@master with: - cmd: yq eval '.tag = "${{ steps.meta.outputs.version }}"' -i values.yaml + cmd: yq eval '.tag = "${{ needs.build.outputs.meta.outputs.tags }}"' -i values.yaml - name: Git Auto Commit if: github.event_name == 'push' uses: stefanzweifel/git-auto-commit-action@v5.0.1 with: - commit_message: "Update deployment image to ${{ steps.meta.outputs.version }}" + commit_message: "Update deployment image tag to ${{ needs.build.outputs.meta.outputs.tags }}" branch: manifest commit_user_name: "github-actions[bot]" commit_user_email: "github-actions[bot]@users.noreply.github.com"