diff --git a/.github/workflows/fly-cleanup.yml b/.github/workflows/fly-cleanup.yml index 89d5e3c4..256d2f0f 100644 --- a/.github/workflows/fly-cleanup.yml +++ b/.github/workflows/fly-cleanup.yml @@ -19,5 +19,5 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master with: - version: 0.0.525 + version: 0.1.66 - run: node buildtools/fly-deploy.js clean diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index 7687b85a..d069d9c1 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master with: - version: 0.0.525 + version: 0.1.66 - id: fly_deploy run: | node buildtools/fly-deploy.js deploy @@ -59,6 +59,6 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master with: - version: 0.0.525 + version: 0.1.66 - id: fly_destroy run: node buildtools/fly-deploy.js destroy diff --git a/buildtools/fly-deploy.js b/buildtools/fly-deploy.js index 29dc79e8..24f2ab89 100644 --- a/buildtools/fly-deploy.js +++ b/buildtools/fly-deploy.js @@ -28,7 +28,6 @@ async function main() { const volName = getVolumeName(); if (!await appExists(name)) { await appCreate(name); - await appScale(name); await volCreate(name, volName); } else { // Check if volume exists, and create it if not. This is needed because there was an API @@ -65,8 +64,7 @@ async function main() { } const appExists = (name) => runFetch(`flyctl status -a ${name}`).then(() => true).catch(() => false); -const appCreate = (name) => runAction(`flyctl apps create ${name} -o ${org}`); -const appScale = (name) => runAction(`flyctl scale memory 1024 -a ${name}`); +const appCreate = (name) => runAction(`flyctl launch --auto-confirm --name ${name} -r ewr -o ${org} --vm-memory 1024`); const volCreate = (name, vol) => runAction(`flyctl volumes create ${vol} -s 1 -r ewr -y -a ${name}`); const volList = (name) => runFetch(`flyctl volumes list -a ${name} -j`).then(({stdout}) => JSON.parse(stdout)); const appDeploy = (name, appRoot) => runAction(`flyctl deploy ${appRoot} --remote-only`, {shell: true, stdio: 'inherit'}); diff --git a/buildtools/fly-template.toml b/buildtools/fly-template.toml index ed8c7fb9..b6846e3f 100644 --- a/buildtools/fly-template.toml +++ b/buildtools/fly-template.toml @@ -1,4 +1,5 @@ app = "{APP_NAME}" +primary_region = "ewr" kill_signal = "SIGINT" kill_timeout = 5 processes = []