Demo Reset #11
This file contains hidden or 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: Demo Reset | |
| # Nightly reset of the demo environment to a clean state with fresh seed data. | |
| # Pulls the latest demo image, wipes per-service databases, runs migrations, | |
| # and re-seeds the volterra_energy demo tenant with fixture data. | |
| # | |
| # Required secrets: | |
| # DEMO_SSH_PRIVATE_KEY - Private SSH key for the deploy user on the Droplet | |
| # DROPLET_IP - IP address of the DigitalOcean Droplet | |
| # DROPLET_SSH_HOST_KEY - Pinned SSH host key entry for the Droplet | |
| # Obtain via: ssh-keyscan -H <droplet-ip> | |
| # Store the full output line as the secret value | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: demo-reset | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| reset: | |
| name: Reset Demo Environment | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| environment: | |
| name: demo | |
| url: https://demo.meridianhub.cloud | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up SSH agent | |
| uses: webfactory/ssh-agent@v0.10.0 | |
| with: | |
| ssh-private-key: ${{ secrets.DEMO_SSH_PRIVATE_KEY }} | |
| - name: Add droplet to known hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| chmod 700 ~/.ssh | |
| printf '%s\n' "${{ secrets.DROPLET_SSH_HOST_KEY }}" >> ~/.ssh/known_hosts | |
| chmod 600 ~/.ssh/known_hosts | |
| - name: Reset demo environment | |
| env: | |
| DEMO_HOST: deploy@${{ secrets.DROPLET_IP }} | |
| NO_CONFIRM: "1" | |
| run: ./scripts/reset-demo.sh |