attempt automirror again #8
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: Push to GitLab Mirror | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
push_to_gitlab: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Install SSH key | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan git.tosdr.org >> ~/.ssh/known_hosts | |
- name: Push to GitLab | |
run: | | |
# Add GitLab as a remote | |
git remote add gitlab [email protected]:tosdr/phoenix.git | |
# Push to the mirror | |
git push --force gitlab master --tags |