mirror of
				https://github.com/suyiiyii/SIMS.git
				synced 2025-11-04 15:54:52 +08:00 
			
		
		
		
	refactor(github-actions): 自动化提交镜像更新和Gitea同步工作流
- 在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:
		
							parent
							
								
									6bffefee2e
								
							
						
					
					
						commit
						8a9612bcb3
					
				
							
								
								
									
										14
									
								
								.github/workflows/docker-publish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/docker-publish.yml
									
									
									
									
										vendored
									
									
								
							@ -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>"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/gitea-sync.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/gitea-sync.yml
									
									
									
									
										vendored
									
									
								
							@ -5,6 +5,8 @@ on:
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
  workflow_run:
 | 
			
		||||
    workflows: ["Docker Build and Publish"]
 | 
			
		||||
    types:
 | 
			
		||||
      - completed
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user