-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
backup-mongo-push-to-server-scp.yml
39 lines (35 loc) · 1.17 KB
/
backup-mongo-push-to-server-scp.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
name: Backup Directory & Push to Another Server
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 Mongo 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: mongo
db_user: ${{ secrets.DB_USER }}
db_pass: ${{ secrets.DB_PASS }}
db_port: 27017
# auth_db: ${{ secrets.authenticationDatabase }} # Required for Mongo DB v4.4.0 - Defaults to admin
db_name: ${{ secrets.DB_NAME }}
# This is just an example use case, not tested.
- name: Push backups to target server via SCP
uses: garygrossgarten/github-action-scp@release
with:
local: /github/workspace/backups
remote: /var/www/backups
host: ${{ secrets.TARGET_IP }}
username: ${{ secrets.TARGET_USER }}
password: ${{ secrets.TARGET_PASS }}