-
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
af893b9
commit 305f127
Showing
1 changed file
with
37 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,37 @@ | ||
name: Push to GitLab | ||
|
||
on: | ||
push: | ||
branches: | ||
- gitlab | ||
|
||
jobs: | ||
push_to_gitlab: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 # Shallow clone to speed up initial checkout | ||
|
||
- name: Convert to full repository | ||
run: git fetch --unshallow | ||
|
||
- name: Ensure main branch exists | ||
run: | | ||
git checkout -b main || git checkout main | ||
- name: Set up Git | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git config --global http.postBuffer 10000000 # 10 MB | ||
- name: Add GitLab remote and push | ||
env: | ||
GITLAB_URL: ${{ secrets.GITLAB_URL }} | ||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | ||
run: | | ||
git remote set-url origin https://oauth2:$GITLAB_TOKEN@$GITLAB_URL | ||
git push origin main |