Skip to content

Commit

Permalink
Create Backup to Gitlab.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
withinJoel authored Oct 8, 2024
1 parent 14539c7 commit e57ded3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/Backup to Gitlab.yml
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

0 comments on commit e57ded3

Please sign in to comment.