mirror of
https://github.com/kmitresse/Master-TI-2.git
synced 2026-05-13 17:11:53 +00:00
Create Mirror_GitHub_GitLab.yml
This commit is contained in:
committed by
Kevin Mitressé
parent
f10206e868
commit
9cb427dcc8
@@ -0,0 +1,44 @@
|
||||
name: Sync with GitLab
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.email "kmitresse@gmail.com"
|
||||
git config --global user.name "Kevin Mitressé"
|
||||
|
||||
- name: Add GitLab remote
|
||||
run: git remote add gitlab https://git.univ-pau.fr/kmitresse/Master-TI-2.git
|
||||
|
||||
- name: Pull from GitLab (merge)
|
||||
env:
|
||||
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
||||
run: |
|
||||
git pull https://$GITLAB_USERNAME:$GITLAB_TOKEN@git.univ-pau.fr/kmitresse/Master-TI-2.git main --rebase
|
||||
|
||||
- name: Push to GitLab
|
||||
env:
|
||||
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
||||
run: |
|
||||
git push https://$GITLAB_USERNAME:$GITLAB_TOKEN@git.univ-pau.fr/kmitresse/Master-TI-2.git main
|
||||
|
||||
- name: Resolve conflicts and continue rebase
|
||||
if: failure() # Execute only if the previous step failed
|
||||
run: |
|
||||
git checkout --ours .
|
||||
git add .
|
||||
git rebase --continue || git rebase --skip
|
||||
|
||||
Reference in New Issue
Block a user