🪞 Mirror 81914b1db26e23f9c32985f1f322ba9f7845653f #2425
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🪞 Mirror | |
| run-name: 🪞 Mirror ${{ github.sha }} | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - maintenance-release | |
| - 'manticore-*' | |
| # waits until the previous workflow run to finish when a new one appears | |
| concurrency: | |
| group: mirror_${{ github.ref }} | |
| jobs: | |
| to_gitlab: | |
| name: Sync to GitLab | |
| if: github.repository == 'manticoresoftware/manticoresearch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Commit info | |
| run: | | |
| echo "# Syncing commit ${{ github.sha }} to GitLab" >> $GITHUB_STEP_SUMMARY | |
| echo "* Commit URL: [${{ github.sha }}](/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY | |
| echo "* Initiated by: [@${{ github.actor }}](https://github.com/${{ github.actor }})" >> $GITHUB_STEP_SUMMARY | |
| echo "* Ref: ${{ github.ref_type }} \"${{ github.ref_name }}\"" >> $GITHUB_STEP_SUMMARY | |
| echo "* Attempt: ${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Sync to Gitlab | |
| run: | | |
| echo "${{ secrets.GITLAB_SSH_KEY }}" > /tmp/ssh.key | |
| chmod 600 /tmp/ssh.key | |
| git remote add gitlab [email protected]:manticoresearch/dev.git | |
| git checkout ${{ github.ref }} | |
| GIT_SSH_COMMAND='ssh -i /tmp/ssh.key -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -F /dev/null' git fetch gitlab | |
| GIT_SSH_COMMAND='ssh -i /tmp/ssh.key -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -F /dev/null' git push -u gitlab ${{ github.ref }} | |
| shell: bash |