-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 909 Bytes
/
gitlab-sync.yml
File metadata and controls
30 lines (28 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Sync all branches to GitLab
on:
push:
branches:
- '**' # Any branch
tags:
- "*.*.*" # e.g. 2.2.0
pull_request:
types: [ closed ]
branches: [ '**' ] # Any branch
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout all branches
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push all branches to GitLab
env:
GITLAB_NAMESPACE: pinontmclab/singularitylab
GITLAB_PROJECT: SingularityLib
GITLAB_URL: https://gitlab.com/$GITLAB_NAMESPACE/$GITLAB_PROJECT.git
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
git remote add gitlab $GITLAB_URL
git push --all https://oauth2:$GITLAB_TOKEN@gitlab.com/$GITLAB_NAMESPACE/$GITLAB_PROJECT.git
git push --tags https://oauth2:$GITLAB_TOKEN@gitlab.com/$GITLAB_NAMESPACE/$GITLAB_PROJECT.git