Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/gitlab synchronization #616

Merged
merged 6 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/mirror-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Mirror repo

on:
workflow_call:
secrets:
GITLAB_URL:
required: true
GITLAB_USER:
required: true
GITLAB_PASSWORD:
required: true

jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: mirror-1
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ secrets.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}

- run: sleep 60s
shell: bash
if: ${{ steps.mirror-1.outcome == 'failure' }}

- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-1.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-1.outcome == 'failure' }}
- id: mirror-2
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ secrets.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-1.outcome == 'failure' }}

- run: sleep 60s
shell: bash
if: ${{ steps.mirror-2.outcome == 'failure' }}

- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-2.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-2.outcome == 'failure' }}
- id: mirror-3
uses: yesolutions/mirror-action@master
continue-on-error: true
with:
REMOTE: ${{ secrets.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-2.outcome == 'failure' }}

- run: sleep 60s
shell: bash
if: ${{ steps.mirror-3.outcome == 'failure' }}

- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ steps.mirror-3.outcome == 'failure' }}
- run: sudo git remote remove mirror || true
if: ${{ steps.mirror-3.outcome == 'failure' }}
- id: mirror-4
uses: yesolutions/mirror-action@master
with:
REMOTE: ${{ secrets.GITLAB_URL }}
GIT_USERNAME: ${{ secrets.GITLAB_USER }}
GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
if: ${{ steps.mirror-3.outcome == 'failure' }}
11 changes: 11 additions & 0 deletions .github/workflows/mirror_repo_to_gitlab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Mirror repo to GitLab

on: [push, delete]

jobs:
call-dream-ops-mirror-workflow:
uses: ./.github/workflows/mirror-repo.yml
secrets:
GITLAB_URL: ${{ secrets.GITLAB_URL }}
GITLAB_USER: ${{ secrets.GITLAB_USER }}
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
Loading