-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (33 loc) · 1.06 KB
/
sync-to-gitlab.yml
File metadata and controls
41 lines (33 loc) · 1.06 KB
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
31
32
33
34
35
36
37
38
39
40
41
name: Sync to GitLab with LFS (optimized)
on:
push:
branches: [ main ]
concurrency:
group: "blog-deploy"
cancel-in-progress: false
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout full history
uses: actions/checkout@v3
with:
fetch-depth: 0 # полный репозиторий для LFS
- name: Install Git LFS
run: |
sudo apt-get update
sudo apt-get install -y git-lfs
git lfs install
- name: Pull all LFS objects
run: git lfs pull
- name: Configure Git
run: |
git config --global user.email "github@actions"
git config --global user.name "GitHub Actions"
- name: Add GitLab remote
env:
GITLAB_USER: ${{ secrets.GITLAB_USER }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: git remote add gitlab https://$GITLAB_USER:$GITLAB_TOKEN@gitlab.com/kagvi13/HMP.git
- name: Push repository with LFS
run: git push --force gitlab main && git lfs push --all gitlab main