-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
14539c7
commit e57ded3
Showing
1 changed file
with
30 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,30 @@ | ||
name: Backup to GitLab | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger on pushes to the main branch | ||
workflow_dispatch: # Allows you to manually trigger the backup | ||
|
||
jobs: | ||
backup: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch full history to avoid shallow update issues | ||
|
||
# Step 2: Set up Git with GitLab credentials | ||
- name: Configure Git to use GitLab | ||
run: | | ||
git config --global user.name "GitHub Backup Bot" | ||
git config --global user.email "[email protected]" | ||
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/withinjoel/elsa.git | ||
# Step 3: Force push to GitLab | ||
- name: Force push to GitLab | ||
run: | | ||
git push -u gitlab main --force |