Skip to content
home

GitHub Action

Git repo backup Action

v0.0.8 Latest version

Git repo backup Action

home

Git repo backup Action

Backup your git repo into another one

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Git repo backup Action

uses: jenkins-zh/git-backup-actions@v0.0.8

Learn more about this action in jenkins-zh/git-backup-actions

Choose a version

Git repo backup Action

GitHub Action for backup your git repository.

Supported Git Provider

Create Deploy Key

  1. Generate deploy key ssh-keygen -t rsa -f git-backup -q -N ""
  2. Then go to "Settings > Deploy Keys" of the target repository
  3. Add your public key within "Allow write access" option.
  4. Copy your private deploy key to GIT_DEPLOY_KEY secret in your source git repository of "Settings > Secrets"

Environment Variables

  • GIT_DEPLOY_KEY: Required, your deploy key (ssh private key) which has Write access
  • TARGET_GIT: required, your backup git repository (please use ssh or git protocol)
  • BRANCH: optional, the branch you want to backup (default value is master)
name: Backup Git Repository

on:
  push:
    branches:
    - master

jobs:
  git-repo-backup:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: git-repo-backup
      uses: jenkins-zh/git-backup-actions@v0.0.1
      env:
        GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
        TARGET_GIT: "git@gitee.com:surenpi/surenpi.git"
        BRANCH: master