name: cloud-train # Runs the pure-CPU JavaScript trainer (node trainer.js -> lib/training.js). # No GPU, no Python, no audiocraft — just Node. Persists checkpoint progress # back to the repo so training is incremental across runs. on: workflow_dispatch: inputs: steps: description: "Training steps to run this invocation" required: false default: "400" schedule: - cron: "0 */6 * * *" # every 6h (cheap CPU loop; adjust cadence as you like) permissions: contents: write concurrency: group: cloud-train cancel-in-progress: false jobs: train: runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: checkout uses: actions/checkout@v4 - name: node uses: actions/setup-node@v4 with: node-version: "20" - name: install deps run: npm ci || npm install - name: train (CPU, pure-JS — no GPU) env: STEPS: ${{ github.event.inputs.steps || '400' }} run: npm run train - name: commit progress run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add checkpoints/ data/ 2>/dev/null || true if git diff --cached --quiet; then echo "no checkpoint changes to commit" else git commit -m "cloud-train: advance training to step $(node -e "console.log(require('./checkpoints/meta.json').step)") [skip ci]" git push fi - name: upload checkpoints artifact if: always() uses: actions/upload-artifact@v4 with: name: checkpoints-${{ github.run_id }} path: checkpoints/** if-no-files-found: warn