Skip to content

Sync prod > preprod #19

Sync prod > preprod

Sync prod > preprod #19

Workflow file for this run

name: Sync databases
on:
workflow_dispatch:
env:
DUPLICATE_API_TOKEN: ${{ secrets.DUPLICATE_API_TOKEN }}
DUPLICATE_SOURCE_APP: ${{ secrets.DUPLICATE_SOURCE_APP }}
PREPROD_DATABASE_URL: ${{ secrets.PREPROD_DATABASE_URL }}
defaults:
run:
shell: bash
jobs:
sync_prod_to_preprod:
name: Sync production databsse to preprod
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Scalingo CLI
run: |
curl -O https://cli-dl.scalingo.com/install && bash install
- name: Login Scalingo CLI
run: scalingo login --api-token "${DUPLICATE_API_TOKEN}"
- name: Execute sync script in one-off container
run: |
scalingo --app ${DUPLICATE_SOURCE_APP} run --env DUPLICATE_API_TOKEN="${DUPLICATE_API_TOKEN}" --env PREPROD_DATABASE_URL="${PREPROD_DATABASE_URL}" --env DUPLICATE_SOURCE_APP="${DUPLICATE_SOURCE_APP}" --file ./scripts/restore_prod_to_preprod.sh /tmp/uploads/restore_prod_to_preprod.sh