name: Apply the configured app server resize when capacity returns # Server type, region, disk growth and storage placement come from config/cloud.ts. # The native driver checks capacity before shutdown and verifies services and # routes after recovery. No provider mutation runs while capacity is unavailable. on: schedule: - cron: '7,37 * * * *' workflow_dispatch: inputs: dry_run: description: Report the configured compute plan without applying it type: boolean default: true concurrency: group: resize-app-server cancel-in-progress: false permissions: actions: write contents: read jobs: resize: runs-on: ubuntu-latest timeout-minutes: 40 concurrency: group: compute-production cancel-in-progress: false env: HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }} DOTENV_PRIVATE_KEY_PRODUCTION: ${{ secrets.DOTENV_PRIVATE_KEY_PRODUCTION }} APP_ENV: production NODE_ENV: production steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Bun uses: pantry-pm/pantry/packages/action@cdb82193cb344c2b881a88ea79f88243f5522e0f # v0.11.75 with: version: '0.11.75' install: 'false' packages: 'bun@1.4.4' - name: Install dependencies run: bun install --frozen-lockfile - name: Prepare deploy SSH identity env: DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} run: | set -euo pipefail if [ -n "$DEPLOY_SSH_KEY" ]; then mkdir -p ~/.ssh chmod 700 ~/.ssh printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-keygen -y -f ~/.ssh/id_ed25519 > ~/.ssh/id_ed25519.pub fi if [ -n "$SSH_KNOWN_HOSTS" ]; then mkdir -p ~/.ssh chmod 700 ~/.ssh printf '%s\n' "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts chmod 600 ~/.ssh/known_hosts fi - name: Apply the configured resize id: apply env: COMPUTE_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} run: bun .github/scripts/deploy/apply-compute.ts - name: Retire the completed resize watcher if: steps.apply.outputs.state == 'done' env: GH_TOKEN: ${{ github.token }} run: gh workflow disable resize-app-server.yml --repo "$GITHUB_REPOSITORY"