forked from keiyoushi/extensions-source
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 964 Bytes
/
Copy pathcodeberg_mirror.yml
File metadata and controls
33 lines (30 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Sync repo to the Codeberg mirror
name: Mirror Sync
on:
push:
branches: [ "main" ]
workflow_dispatch: # Manual dispatch
schedule:
- cron: "0 */8 * * *"
permissions: {}
jobs:
codeberg:
if: "github.repository == 'keiyoushi/extensions-source'"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.CODEBERG_SSH }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Mirror repository
run: |
git remote add mirror "git@codeberg.org:keiyoushi/extensions-source.git"
git push --force --prune mirror "refs/remotes/origin/main:refs/heads/main"
env:
GIT_SSH_COMMAND: "ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -l git"