added github mirror
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Mirror main to GitHub (shallow) / mirror (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Mirror main to GitHub (shallow) / mirror (push) Has been cancelled
				
			This commit is contained in:
		
							
								
								
									
										56
									
								
								.gitea/workflows/github_mirror.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								.gitea/workflows/github_mirror.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,56 @@ | |||||||
|  | name: Mirror main to GitHub (shallow) | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: ["main"]        # nur main triggern | ||||||
|  |   workflow_dispatch:          # manuell startbar | ||||||
|  |  | ||||||
|  | concurrency: | ||||||
|  |   group: mirror-main-to-github | ||||||
|  |   cancel-in-progress: false | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   mirror: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |  | ||||||
|  |       - name: Checkout (shallow, no history) | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |         with: | ||||||
|  |           fetch-depth: 1       # <— wichtig: keine alte Historie | ||||||
|  |           lfs: true            # falls LFS-Dateien im aktuellen Commit liegen | ||||||
|  |  | ||||||
|  |       - name: Install git-lfs | ||||||
|  |         run: | | ||||||
|  |           sudo apt-get update | ||||||
|  |           sudo apt-get install -y git-lfs | ||||||
|  |           git lfs install | ||||||
|  |  | ||||||
|  |       - name: Add GitHub remote | ||||||
|  |         env: | ||||||
|  |           GH_USER: ${{ secrets.GH_USER }} | ||||||
|  |           GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||||||
|  |           GH_OWNER: ${{ secrets.GH_OWNER }} | ||||||
|  |           GH_REPO: ${{ secrets.GH_REPO }} | ||||||
|  |         run: | | ||||||
|  |           set -euo pipefail | ||||||
|  |           : "${GH_USER?missing}"; : "${GH_TOKEN?missing}"; : "${GH_OWNER?missing}"; : "${GH_REPO?missing}" | ||||||
|  |           git remote remove mirror 2>/dev/null || true | ||||||
|  |           git remote add mirror "https://${GH_USER}:${GH_TOKEN}@github.com/${GH_OWNER}/${GH_REPO}.git" | ||||||
|  |  | ||||||
|  |       - name: Push main branch (shallow) | ||||||
|  |         run: | | ||||||
|  |           # force ist i. d. R. nicht nötig; nur, wenn du auf GitHub main überschreiben willst | ||||||
|  |           git push mirror HEAD:refs/heads/main | ||||||
|  |  | ||||||
|  |       - name: Push LFS objects for current commit | ||||||
|  |         env: | ||||||
|  |           GH_USER: ${{ secrets.GH_USER }} | ||||||
|  |           GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||||||
|  |           GH_OWNER: ${{ secrets.GH_OWNER }} | ||||||
|  |           GH_REPO: ${{ secrets.GH_REPO }} | ||||||
|  |         run: | | ||||||
|  |           set -euo pipefail | ||||||
|  |           REMOTE="https://${GH_USER}:${GH_TOKEN}@github.com/${GH_OWNER}/${GH_REPO}.git" | ||||||
|  |           # Nur Objekte, die lokal vorhanden sind (durch lfs: true) – somit kein Altbestand | ||||||
|  |           git lfs push "$REMOTE" --all | ||||||
		Reference in New Issue
	
	Block a user