-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (60 loc) · 2.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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/[email protected]
- name: Store day of week
run: echo "week_day=$(date +%a)" >> $GITHUB_ENV
- uses: ./.github/actions/dingorunner
env:
runner: cr
terminus_api: ${{ secrets.TERMINUS_API }}
SSH_PRIVATE_KEY: ${{ secrets.PANTHEON_DEPLOY_KEY}}
site_name: ${{ secrets.TERMINUS_SITE_NAME }}
env: live
- 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@main
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 -y
lando drush cim
lando drush cr
lando drush updb
lando drush user-create authenticated_test_user --mail="[email protected]" --password="6%l7iF}6(4tI"
lando drush user-create administrator_test_user --mail="[email protected]" --password="b8QW]X9h7#5n"
lando drush user-add-role "administrator" administrator_test_user
lando drush en amp_dev
lando drush pmu amp_dev
lando drush pmu symfony_mailer
lando drush en symfony_mailer
lando drush cr
lando db-export site.sql
env:
gh_token: ${{ secrets.GH_TOKEN_REPO }}
- name: 'Upload Backup Artifact'
uses: actions/[email protected]
with:
name: amp-daily-backup
path: site.sql.gz
retention-days: 5