GitHub Action for periodically backup a your database (MySQL, Postgres or MongoDB) to Local Disk or S3 (AWS S3 or Minio).
- name: backup postgres
uses: ./
with:
database_driver: postgres
database_username: db
database_password: db
database_name: db
database_host: postgres:5432
storage_driver: s3
access_key_id: 1234567890
secret_access_key: 1234567890
storage_endpoint: minio:9000
storage_bucket: test
storage_region: ap-northeast-1
storage_path: backup
- name: backup mysql
uses: ./
with:
database_driver: mysql
database_username: db
database_password: db
database_name: db
database_host: mysql:3306
storage_driver: s3
access_key_id: 1234567890
secret_access_key: 1234567890
storage_endpoint: minio:9000
storage_bucket: test
storage_region: ap-northeast-1
storage_path: backup
- name: backup mongo
uses: ./
with:
database_driver: mongo
database_username: db
database_password: db
database_name: db
database_host: mongo:27017
database_opts: "--authenticationDatabase admin"
storage_driver: s3
access_key_id: 1234567890
secret_access_key: 1234567890
storage_endpoint: minio:9000
storage_bucket: test
storage_region: ap-northeast-1
storage_path: backup
See action.yml for more detailed information.
- database_driver - support
postgres
,mysql
ormongo
. default ispostgres
- database_username - database username
- database_password - database password
- database_name - database name
- database_host - database host
- database_opts - see the
pg_dump
,mysqldump
ormongodump
command
- storage_driver - support
s3
ordisk
. default iss3
- access_key_id - minio or aws s3 access key id
- secret_access_key - minio or aws s3 secret access key
- storage_endpoint - s3 endpoint. default is
s3.amazonaws.com
- storage_bucket - s3 bucket name
- storage_region - s3 region. default is
ap-northeast-1
- storage_path - backup folder path in bucket. default is
backup
and all dump file will save inbucket/backup
directory - storage_ssl - default is
false
- storage_insecure_skip_verify - default is
false
- time_schedule - you may use one of several pre-defined schedules in place of a cron expression.
- time_location - by default, all interpretation and scheduling is done in the machine's local time zone. you can specify a different time zone on construction.