-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
backup-postgres-push-to-s3.yml
40 lines (36 loc) · 1.22 KB
/
backup-postgres-push-to-s3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Backup Directory & Push to S3 Bucket
on:
schedule:
- cron: "0 0 * * *" # Every Day at Midnight
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Backup Postgres DB
uses: valerianpereira/backup-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }} # Defaults to root
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
key: ${{ secrets.DEPLOY_KEY }}
type: db
db_type: postgres
db_user: ${{ secrets.DB_USER }}
db_pass: ${{ secrets.DB_PASS }}
db_port: 5432 # Defaults to 5432
db_name: ${{ secrets.DB_NAME }}
# This is just an example use case, not tested.
- name: Push backups to S3 Bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'public' # optional: defaults to entire repository