chore(ci): merge CNB and AtomGit mirror sync into single workflow

This commit is contained in:
t8y2 2026-06-18 15:06:46 +08:00
parent 5ffd0bad6c
commit 80d33e1990
2 changed files with 47 additions and 34 deletions

47
.github/workflows/sync-mirrors.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Sync Mirrors
on:
push:
branches:
- main
tags:
- "**"
delete:
workflow_dispatch:
jobs:
sync-cnb:
name: Sync to CNB
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to CNB
env:
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
run: |
set -euo pipefail
git remote add cnb "https://cnb:${CNB_TOKEN}@cnb.cool/dbxio.com/dbx.git"
git push cnb --all --force
git push cnb --tags --force
sync-atomgit:
name: Sync to AtomGit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to AtomGit
env:
ATOMGIT_TOKEN: ${{ secrets.ATOMGIT_TOKEN }}
run: |
set -euo pipefail
git remote add atomgit "https://t8y2:${ATOMGIT_TOKEN}@atomgit.com/t8y2/dbx.git"
git push atomgit --all --force
git push atomgit --tags --force

View File

@ -1,34 +0,0 @@
name: Sync to CNB
on:
push:
branches:
- main
tags:
- "**"
delete:
workflow_dispatch:
env:
CNB_REPOSITORY: "dbxio.com/dbx"
CNB_USERNAME: "cnb"
jobs:
sync:
name: Sync repository to CNB
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to CNB mirror
env:
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
run: |
set -euo pipefail
git remote add cnb "https://${CNB_USERNAME}:${CNB_TOKEN}@cnb.cool/${CNB_REPOSITORY}.git"
git push cnb --all --force
git push cnb --tags --force