File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Push to GitLab
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - gitlab
7
+
8
+ jobs :
9
+ push_to_gitlab :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v2
15
+ with :
16
+ fetch-depth : 1 # Shallow clone to speed up initial checkout
17
+
18
+ - name : Convert to full repository
19
+ run : git fetch --unshallow
20
+
21
+ - name : Ensure main branch exists
22
+ run : |
23
+ git checkout -b main || git checkout main
24
+
25
+ - name : Set up Git
26
+ run : |
27
+ git config --global user.name 'github-actions'
28
+ git config --global user.email '[email protected] '
29
+ git config --global http.postBuffer 10000000 # 10 MB
30
+
31
+ - name : Add GitLab remote and push
32
+ env :
33
+ GITLAB_URL : ${{ secrets.GITLAB_URL }}
34
+ GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
35
+ run : |
36
+ git remote set-url origin https://oauth2:$GITLAB_TOKEN@$GITLAB_URL
37
+ git push origin main
You can’t perform that action at this time.
0 commit comments