refactor(github-actions): 自动化提交镜像更新和Gitea同步工作流
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
gitea-sync.yml / trigger-gitea-sync (push) Waiting to run
Java CI with Maven / build (push) Waiting to run

- 在docker-publish.yml中引入yq Linux二进制文件并设置权限,用于在'push'事件中自动更新部署镜像标签。
- 用git-auto-commit-action自动化提交更新到GitHub,使用机器用户凭据。- 在gitea-sync.yml中增加workflow_run事件的类型限定,仅在'Docker Build and Publish'工作流完成时触发。
This commit is contained in:
suyiiyii 2024-08-25 19:32:28 +08:00
parent 6bffefee2e
commit 8a9612bcb3
2 changed files with 13 additions and 3 deletions

View File

@ -105,7 +105,15 @@ jobs:
if: github.event_name == 'push'
run: |
echo "Updating manifest"
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq
yq eval '.image.tag = "${{ steps.meta.outputs.tags }}"' -i values.yaml
git add values.yaml
git commit -m "Update deployment image to ${{ steps.meta.outputs.tags }}"
git push
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: "Update deployment image to ${{ steps.meta.outputs.tags }}"
branch: manifest
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

View File

@ -5,6 +5,8 @@ on:
workflow_dispatch:
workflow_run:
workflows: ["Docker Build and Publish"]
types:
- completed
jobs: