https://github.com/sammcj/backup-git-to-s3-action
Github Action to backup a git repository to s3
https://github.com/sammcj/backup-git-to-s3-action
Last synced: 20 days ago
JSON representation
Github Action to backup a git repository to s3
- Host: GitHub
- URL: https://github.com/sammcj/backup-git-to-s3-action
- Owner: sammcj
- License: mit
- Created: 2022-09-01T02:56:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T10:57:47.000Z (about 1 year ago)
- Last Synced: 2024-09-06T09:46:38.420Z (about 1 year ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 127
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backup git to S3 Action
[](https://github.com/sammcj/backup-git-to-s3-action/workflows/bump-version)
[](https://img.shields.io/github/v/tag/sammcj/backup-git-to-s3-action)
[](https://img.shields.io/github/v/release/sammcj/backup-git-to-s3-action?color=%233D9970)This action will compress and backup a given git repository to S3.
## Usage
```yaml
backup:
runs-on: ubuntu-latest
steps:
- name: Checkout repo to be backed up
uses: actions/checkout@v3
with:
fetch-depth: 0
path: repo-to-backup- name: Backup repo to s3
uses: sammcj/backup-git-to-s3-action@main
with:
s3-bucket: 'my-s3-bucket-name'
s3-prefix: 'githubRepoBackup'
s3-region: 'ap-southeast-2'
repository-path: 'repo-to-backup'
```## Inputs
```yaml
s3-bucket:
type: string
required: true
description: 'The S3 bucket name'
s3-prefix:
type: string
required: false
description: 'The S3 prefix to use for the backup'
default: 'githubRepoBackup'
s3-region:
type: string
required: false
description: 'The S3 region to use for the backup'
default: 'ap-southeast-2'
repository-name:
type: string
required: false
description: 'The name of the repository to backup, defaults to the current repository name'
repository-path:
type: string
required: false
description: 'The temporary path for the repository to clone and backup, defaults to ./repo-to-backup/'
default: './repo-to-backup/'
temp-dir:
type: string
required: false
description: 'The temporary directory to use for the backup, defaults to /tmp'
default: '/tmp'
tar-command:
type: string
required: false
description: 'The tar command to use to compress the git repo, defaults to tar -czvf'
default: 'tar -czvf'
```## Assumptions
- You are authenticated to AWS.
- e.g. [AWS configure-aws-credentials Action](https://github.com/aws-actions/configure-aws-credentials)
- You have the correct permissions to write to the S3 bucket.
- You can run the aws cli (e.g. `aws s3 ls`).
- You have tar installed (e.g. `tar --version`).