-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (44 loc) · 1.24 KB
/
backupdb.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
41
42
43
44
45
46
47
48
name: (A) Database to artifact
on:
workflow_dispatch:
schedule:
- cron: '16 11 * * *'
permissions:
contents: write
actions: read
pull-requests: write
jobs:
build:
name: Grab backup and fix backup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dingorunner
env:
runner: bkup
terminus_api: ${{ secrets.TERMINUS_API }}
SSH_PRIVATE_KEY: ${{ secrets.PANTHEON_DEPLOY_KEY}}
site_name: ${{ secrets.TERMINUS_SITE_NAME }}
env: live
- id: Lando
uses: necyberteam/amp_lando_start@v2
with:
DATABASE: ''
GH_TOKEN_REPO: ${{ secrets.GH_TOKEN_REPO }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sanitize backup
run: |
lando drush sql-sanitize --sanitize-password -y
lando drush deploy
lando drush en amp_dev
lando drush pmu amp_dev
lando drush cr
lando db-export site.sql
env:
gh_token: ${{ secrets.GH_TOKEN_REPO }}
- name: 'Upload Backup Artifact'
uses: actions/upload-artifact@v3
with:
name: amp-daily-backup
path: site.sql.gz
retention-days: 5