Update 4 files #6
This file contains 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: Mirroring | |
on: [push, delete] | |
jobs: | |
to_gitlab: | |
runs-on: ubuntu-latest | |
container: | |
image: getflow/cloudflared-ssh:latest | |
env: | |
TOKEN_ID: ${{ secrets.CLOUDFLARED_TOKEN_ID }} | |
TOKEN_SECRET: ${{ secrets.CLOUDFLARED_TOKEN_SECRET }} | |
steps: # <-- must use actions/checkout before mirroring! | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup ssh | |
run: | | |
echo "${{ secrets.GITLAB_MIRROR_BOT_KEY }}" > /root/.ssh/id_rsa | |
chmod 600 /root/.ssh/id_rsa | |
- name: Push to mirror | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git remote add mirror "${{ secrets.GITLAB_MIRROR_REPOSITORY }}" | |
git push --tags --force --prune mirror "refs/remotes/origin/*:refs/heads/*" |