Database Dump #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: Database Dump | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' # Every Monday at midnight UTC | |
| workflow_dispatch: | |
| jobs: | |
| backup: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '24' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --filter @semianalysisai/inferencex-db... | |
| env: | |
| CYPRESS_INSTALL_BINARY: '0' | |
| - name: Dump database | |
| env: | |
| DATABASE_READONLY_URL: ${{ secrets.DATABASE_READONLY_URL }} | |
| run: | | |
| DUMP_DIR="inferencex-dump-$(date -u +%Y-%m-%d)" | |
| pnpm admin:db:dump "$DUMP_DIR" | |
| cd packages/db && zip -r "${GITHUB_WORKSPACE}/${DUMP_DIR}.zip" "$DUMP_DIR" && cd - | |
| echo "DUMP_ARCHIVE=${DUMP_DIR}.zip" >> "$GITHUB_ENV" | |
| echo "TAG=db-dump/$(date -u +%Y-%m-%d)" >> "$GITHUB_ENV" | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "$TAG" "$DUMP_ARCHIVE" \ | |
| --title "DB Dump $(date -u +%Y-%m-%d)" \ | |
| --notes "Weekly database dump." \ | |
| --latest=false |