This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Sync to GitLab | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger on pushes to the main branch | ||
|
||
jobs: | ||
push-to-gitlab: | ||
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 "actions@github.com" | ||
- name: Add GitLab remote | ||
env: | ||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
run: | | ||
git remote add gitlab https://oauth2:$GITLAB_TOKEN@gitlab.com/bashaHub/TrendTrack.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 |