(A) Database to artifact #498
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -y | |
lando drush cim | |
lando drush cr | |
lando drush updb | |
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 |