mirror of
https://github.com/igareck/vpn-configs-for-russia.git
synced 2026-05-29 12:27:05 +00:00
Зеркало / Mirror to SourceHut
Создание зеркала на git.sr.ht (SourceHut.org) Create a mirror on git.sr.ht (SourceHut.org)
This commit is contained in:
22
.github/workflows/mirror-to-sourcehut.yml
vendored
22
.github/workflows/mirror-to-sourcehut.yml
vendored
@@ -23,19 +23,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Configure HTTPS auth for SourceHut
|
- name: Configure SSH for SourceHut
|
||||||
env:
|
env:
|
||||||
SOURCEHUT_TOKEN: ${{ secrets.SOURCEHUT_TOKEN }}
|
SOURCEHUT_SSH_PRIVATE_KEY: ${{ secrets.SOURCEHUT_SSH_PRIVATE_KEY }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
cat > ~/.netrc <<EOF
|
mkdir -p ~/.ssh
|
||||||
machine git.sr.ht
|
chmod 700 ~/.ssh
|
||||||
login igareck
|
|
||||||
password ${SOURCEHUT_TOKEN}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod 600 ~/.netrc
|
printf '%s\n' "$SOURCEHUT_SSH_PRIVATE_KEY" > ~/.ssh/sourcehut_mirror_ed25519
|
||||||
|
chmod 600 ~/.ssh/sourcehut_mirror_ed25519
|
||||||
|
|
||||||
|
ssh-keyscan git.sr.ht >> ~/.ssh/known_hosts
|
||||||
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Push main branch to SourceHut
|
- name: Push main branch to SourceHut
|
||||||
run: |
|
run: |
|
||||||
@@ -45,6 +46,7 @@ jobs:
|
|||||||
git config user.email "github-actions@github.com"
|
git config user.email "github-actions@github.com"
|
||||||
|
|
||||||
git remote remove sourcehut 2>/dev/null || true
|
git remote remove sourcehut 2>/dev/null || true
|
||||||
git remote add sourcehut "https://git.sr.ht/~igareck/vpn-configs-for-russia"
|
git remote add sourcehut "git@git.sr.ht:~igareck/vpn-configs-for-russia"
|
||||||
|
|
||||||
git push sourcehut HEAD:main --force
|
GIT_SSH_COMMAND="ssh -i ~/.ssh/sourcehut_mirror_ed25519 -o IdentitiesOnly=yes" \
|
||||||
|
git push sourcehut HEAD:main --force
|
||||||
|
|||||||
Reference in New Issue
Block a user