-
Notifications
You must be signed in to change notification settings - Fork 56
33 lines (27 loc) · 938 Bytes
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Sync to GitLab
on:
push:
branches:
- main # Trigger on pushes to the main branch
jobs:
push-to-gitlab:
if: github.repository == 'Bashamega/WebDevTools'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all commit history to avoid shallow clone issues
- name: Set up Git for GitLab
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Add GitLab remote
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
git remote add gitlab https://oauth2:[email protected]/bashaHub/web-dev-tools.git
git fetch gitlab
- name: Push changes to GitLab
run: |
git push gitlab HEAD:main --force # Push the current branch to the main branch on GitLab