Skip to content

Commit

Permalink
Initialize Gitlab mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottanet committed Mar 23, 2024
1 parent 28eacd0 commit 26d2cc6
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/init_mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Initialize Gitlab mirror

on:
push:
branches:
- main

jobs:
sync_to_gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Extract repository name
id: extract_repo_name
run: echo "::set-output name=reponame::$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)"

- name: Set up Git
run: |
git config --global user.name "${{ secrets.GITLAB_USER }}"
git config --global user.email "${{ secrets.GITLAB_EMAIL }}"
env:
GITLAB_USER: ${{ secrets.GITLAB_USER }}
GITLAB_EMAIL: ${{ secrets.GITLAB_EMAIL }}

- name: Remove shallow update
run: git fetch --prune --unshallow

- name: Push to GitLab
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/rmottanet/${{ steps.extract_repo_name.outputs.reponame }}.git
git push --set-upstream gitlab --all
git push --set-upstream gitlab --tags
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Mirror

on:
pull_request:
types: [closed]
branches: [ "main" ]

jobs:
sync_to_gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Extract repository name
id: extract_repo_name
run: echo "::set-output name=reponame::$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)"

- name: Set up Git
run: |
git config --global user.name "${{ secrets.GITLAB_USER }}"
git config --global user.email "${{ secrets.GITLAB_EMAIL }}"
- name: Sync to GitLab
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/rmottanet/${{ steps.extract_repo_name.outputs.reponame }}.git
git fetch --prune --unshallow
git checkout main
git merge --allow-unrelated-histories -X theirs --no-edit origin/main
git push gitlab main
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
./python/.env/*
./cpp/bin/*

.env
14 changes: 14 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Mirroring on Github

stages:
- mirror

mirror:
stage: mirror
script:
- export REPO_NAME=$(echo $CI_PROJECT_PATH | cut -d'/' -f2)
- git remote add github https://${GITHUB_TOKEN}@github.com/rmottanet/$REPO_NAME.git
- git checkout -b main
- git push --set-upstream github main
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request" && $CI_MERGE_REQUEST_EVENT_TYPE == "close"'
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

Pong Study Repository: A Linguistic Exploration. A repository dedicated to the meticulous examination of the classic game Pong.

Hey there, fellow game enthusiasts! Welcome to my personal exploration of the classic Pong game, but with a quirky twist – I call it [PongCraft](https://github.com/PongCraft) Adventures!
Hey there, fellow game enthusiasts! Welcome to my personal exploration of the classic [Pong](https://rmottanet.github.io/pongtopia/) game, but with a quirky twist – I call it [PongCraft](https://github.com/PongCraft) Adventures!

Dive into the PongCraft world in various programming languages like Python, MIT Scratch, JavaScript, and Java. If you're curious and ready to embark on this solo coding journey with me, check out the different versions in my repository PongCraft. Each language brings its unique flavor to the game, allowing me to unravel the mysteries of code one paddle swing at a time.

Curious about different languages? Check out [PongCraft](https://github.com/PongCraft) for alternative versions. No need for redundant invites – just dive in and paddle through the coding adventure.

Legal Stuff – Legalities are covered under the MIT License. Refer to the documentation for details.

Got questions or suggestions? Let's chat. Explore Pong across diverse languages in the [PongCraft](https://github.com/PongCraft) domain.
---

Got questions or suggestions? Let's chat. Explore Pong across diverse languages in the [PongCraft](https://github.com/PongCraft) domain.

Thank you for visiting [Pongtopia!](https://rmottanet.github.io/pongtopia/) If you have any questions, issues, or suggestions, please don't hesitate to reach out. Happy gaming! 🎮

<br />
<br />
<p align="center">
<a href="https://gitlab.com/rmottanet"><img src="https://img.shields.io/badge/Gitlab--_.svg?style=social&logo=gitlab" alt="GitLab"></a>
<a href="https://github.com/rmottanet"><img src="https://img.shields.io/badge/Github--_.svg?style=social&logo=github" alt="GitHub"></a>
<a href="https://instagram.com/rmottanet/"><img src="https://img.shields.io/badge/Instagram--_.svg?style=social&logo=instagram" alt="Instagram"></a>
<a href="https://www.linkedin.com/in/rmottanet/"><img src="https://img.shields.io/badge/Linkedin--_.svg?style=social&logo=linkedin" alt="Linkedin"></a>
</p>
<br />

0 comments on commit 26d2cc6

Please sign in to comment.