mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 12:28:30 +00:00
- Add GitHub Actions workflows for code and release mirroring - Remove manual sync-releases-to-gitlab.py script - Update .gitignore to track .github/ directory - Document repository mirrors and VS Code extension recommendations
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: Mirror source code to GitVerse
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: code-mirror-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
mirror:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Mirror all branches
|
|
env:
|
|
GITVERSE_PAT: ${{ secrets.GITVERSE_PAT }}
|
|
GITVERSE_ORG: ${{ vars.GITVERSE_ORG || 'dcr_labs' }}
|
|
GITVERSE_REPO: ${{ vars.GITVERSE_REPO || 'dcr' }}
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; }
|
|
remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git"
|
|
git remote add gitverse "$remote"
|
|
# Populate local refs first, so a manual run mirrors every branch too.
|
|
git fetch origin '+refs/heads/*:refs/heads/*'
|
|
git push --prune --force gitverse 'refs/heads/*:refs/heads/*'
|