chore: update test commit #16
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: Mirror to Codeberg | |
on: | |
push: | |
jobs: | |
mirror: | |
name: Mirror to Codeberg | |
runs-on: ubuntu-latest | |
env: | |
MIRROR_REPO: ${{ secrets.CODEBERG_MIRROR_LEFTWM }} | |
steps: | |
- name: Clone repository | |
if: env.MIRROR_REPO != '' | |
run: | | |
git config --global url."https://${{ secrets.GITHUB_TOKEN }}@github.com".insteadOf https://github.com | |
git clone --bare --mirror "https://github.com/${{ github.repository }}" clone.git | |
- name: Load ssh key | |
if: env.MIRROR_REPO != '' | |
run: | | |
umask 066 | |
echo "${{ secrets.CODEBERG_MIRROR_LEFTWM_SSH_KEY }}" > ~/mirror_key | |
- name: Add Codeberg to known hosts | |
if: env.MIRROR_REPO != '' | |
run: echo "codeberg.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIVIC02vnjFyL+I4RHfvIGNtOgJMe769VTF1VR4EB3ZB" > ~/known_hosts | |
- name: Push to Codeberg | |
if: env.MIRROR_REPO != '' | |
env: | |
GIT_SSH_COMMAND: 'ssh -i ~/mirror_key -o IdentitiesOnly=yes -o GlobalKnownHostsFile=~/known_hosts -o StrictHostKeyChecking=yes' | |
run: git -C clone.git push --mirror "$MIRROR_REPO" | |
- name: Delete key file | |
if: env.MIRROR_REPO != '' | |
run: rm ~/mirror_key |