File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 11name : Backup PostgreSQL Database
22
33on :
4- schedule :
5- - cron : " 0 19 * * *"
6- pull_request :
7- branches :
8- - main
9- push :
10- branches :
11- - main
4+ repository_dispatch :
5+ types : [backup-database]
126
137jobs :
148 backup :
2519 sudo apt-get update
2620
2721 - name : Install PostgreSQL Client
28- run : |
29- sudo apt-get install -y postgresql-client-15
22+ run : sudo apt-get install -y postgresql-client-15
3023
3124 - name : Backup database
3225 run : |
3831 env :
3932 PGPASSWORD : ${{ secrets.PG_PASSWORD }}
4033
41- - name : Upload backup to GitHub
42- uses : actions/upload-artifact@v3
43- with :
44- name : pg-dump-backup
45- path : backup.sql
34+ - name : Copy backup to local
35+ run : |
36+ mkdir -p ~/db_backups
37+ cp backup.sql ~/db_backups/backup_$(date +'%Y%m%d%H%M%S').sql
You can’t perform that action at this time.
0 commit comments