From 305f127e8752f9294caeadf3467fb82c1be22df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roque=20L=C3=B3pez?= Date: Wed, 29 May 2024 21:23:33 -0400 Subject: [PATCH] Create push_gitlab.yml --- .github/workflows/push_gitlab.yml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/push_gitlab.yml diff --git a/.github/workflows/push_gitlab.yml b/.github/workflows/push_gitlab.yml new file mode 100644 index 0000000..ff011c7 --- /dev/null +++ b/.github/workflows/push_gitlab.yml @@ -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 'actions@github.com' + 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