From c83fa1bf533245052644785e44e5a71033d909cd Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 12:26:13 +0200 Subject: [PATCH 01/27] WIP railway deploy test --- .github/workflows/test-deploy.yaml | 110 ++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 279489232f..c4b9091f26 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -7,6 +7,8 @@ on: - ".github/**" branches: - main + # TODO: remove before merging this PR + - miho-railway-deployment-test-ci tags: - v* workflow_dispatch: @@ -15,11 +17,12 @@ env: APP_PREFIX: ci-${{ github.sha }} FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }} FLY_REGION: mia + RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} APP_TO_DEPLOY: waspc/examples/todoApp jobs: fly_deploy_app: - name: Deploy Wasp app + name: Deploy Wasp app to Fly.io runs-on: ubuntu-latest @@ -79,7 +82,7 @@ jobs: server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }} client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }} - smoke_test_app: + fly_smoke_test_app: name: Run smoke tests on deployed app runs-on: ubuntu-latest @@ -100,7 +103,7 @@ jobs: fly_destroy_app: runs-on: ubuntu-latest name: Clean up deployed Fly app - needs: [fly_deploy_app, smoke_test_app] + needs: [fly_deploy_app, fly_smoke_test_app] # NOTE: Fly deployments can sometimes "fail" but still deploy the apps. We # want to always clean them up. if: always() @@ -119,3 +122,104 @@ jobs: flyctl apps destroy -y $APP_PREFIX-server || true flyctl apps destroy -y $APP_PREFIX-client || true flyctl apps destroy -y $APP_PREFIX-db || true + + railway_deploy_app: + name: Deploy Wasp app to Railway + + runs-on: ubuntu-latest + + environment: + name: railway-deploy-test + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup-haskell + + - uses: actions/setup-node@v4 + with: + cache: "npm" + node-version: "22" + + - name: Install Wasp CLI + working-directory: waspc + run: ./run install + + - name: Install Railway CLI + run: | + npm install -g @railway/cli + + - name: Deploy App to Railway + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + set -e + + # NOTE: This assumes env var values don't contain: + # - The character `#`. + # - An empty line (i.e., there are no multiline env values). + mapfile -t ENV_VAR_ARGUMENTS < <( + cat .env.server.example | + sed -E 's/#.*//' | + awk 'NF {$1=$1;print}' | + sed -E 's/^/--server-secret\n/' + ) + + echo "Deploying with prefix: $APP_PREFIX" + # NOTE: + # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper + # word splitting (i.e., force Bash to interpret the flags separately + # instead of passing it as a single string value). + wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" + + - name: Save deployed app hostnames + id: save_hostnames + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + server_service_name="${APP_PREFIX}-server" + client_service_name="${APP_PREFIX}-client" + + echo "server_hostname=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" + echo "client_hostname=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" + outputs: + server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }} + client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }} + + railway_smoke_test_app: + name: Run smoke tests on deployed app + + runs-on: ubuntu-latest + needs: railway_deploy_app + env: + SERVER_HOSTNAME: ${{ needs.railway_deploy_app.outputs.server_hostname }} + CLIENT_HOSTNAME: ${{ needs.railway_deploy_app.outputs.client_hostname }} + + steps: + - name: Smoke test the server + run: | + curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq '.json' + + - name: Smoke test the client + run: | + curl --fail --silent https://$CLIENT_HOSTNAME | grep 'ToDo App' + + railway_destroy_app: + runs-on: ubuntu-latest + name: Clean up deployed Fly app + needs: [railway_deploy_app, railway_smoke_test_app] + # NOTE: Fly deployments can sometimes "fail" but still deploy the apps. We + # want to always clean them up. + if: always() + + steps: + - uses: actions/setup-node@v4 + with: + cache: "npm" + node-version: "22" + + - name: Install Railway CLI + run: | + npm install -g @railway/cli + + - name: Clean up testing app from Railway + run: | + echo "Not implemented yet, manually delete the project in Railway dashboard" From 22dd692391450345bed8597049c612bbcb700e8f Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 12:56:04 +0200 Subject: [PATCH 02/27] Update Railway cleanup cache. Naming. --- .github/workflows/test-deploy.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index c4b9091f26..28b8895bfb 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -204,7 +204,7 @@ jobs: railway_destroy_app: runs-on: ubuntu-latest - name: Clean up deployed Fly app + name: Clean up deployed Railway app needs: [railway_deploy_app, railway_smoke_test_app] # NOTE: Fly deployments can sometimes "fail" but still deploy the apps. We # want to always clean them up. @@ -213,7 +213,9 @@ jobs: steps: - uses: actions/setup-node@v4 with: - cache: "npm" + # We install Railway CLI globally using npm, so we don't need + # package manager cache here. + package-manager-cache: false node-version: "22" - name: Install Railway CLI From ad40c39a2c9f8d3f568da3334cd8774fc7dfdfa6 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 13:41:37 +0200 Subject: [PATCH 03/27] Testing Railway token login --- .github/workflows/test-deploy.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 28b8895bfb..1a202c6b0f 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -169,6 +169,8 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). + echo $RAILWAY_API_TOKEN + railway login --token $RAILWAY_API_TOKEN wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames @@ -213,9 +215,6 @@ jobs: steps: - uses: actions/setup-node@v4 with: - # We install Railway CLI globally using npm, so we don't need - # package manager cache here. - package-manager-cache: false node-version: "22" - name: Install Railway CLI From b8545eedfb9734721c73a2539da4932f425e5b87 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 14:03:23 +0200 Subject: [PATCH 04/27] Pass RAILWAY_API_TOKEN expliclty to wasp-cli --- .github/workflows/test-deploy.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 1a202c6b0f..9ff8f55ddc 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -170,8 +170,7 @@ jobs: # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). echo $RAILWAY_API_TOKEN - railway login --token $RAILWAY_API_TOKEN - wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" + RAILWAY_API_TOKEN=$RAILWAY_API_TOKEN wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames From 8a4dd3678d813c5ff7278a034be361e236e57d6d Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 14:44:12 +0200 Subject: [PATCH 05/27] Login with Railway CLI before calling Wasp CLI --- .github/workflows/test-deploy.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 9ff8f55ddc..de02e8f541 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -169,8 +169,10 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - echo $RAILWAY_API_TOKEN - RAILWAY_API_TOKEN=$RAILWAY_API_TOKEN wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" + # - Railway login is the only place where the RAILWAY_API_TOKEN, so we need to + # login in before calling the Wasp CLI deploy command. + railway login + wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames From 249b2fbaf536a3e1f40c7c494428e2a35cf03186 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 17:01:20 +0200 Subject: [PATCH 06/27] Add workspace ID --- .github/workflows/test-deploy.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index de02e8f541..0814a0b1b0 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -18,6 +18,7 @@ env: FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }} FLY_REGION: mia RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} + RAILWAY_WASP_WORKSPACE_ID: 22f3bf34-c18e-4846-92b9-efb42c23955e APP_TO_DEPLOY: waspc/examples/todoApp jobs: @@ -169,10 +170,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - # - Railway login is the only place where the RAILWAY_API_TOKEN, so we need to - # login in before calling the Wasp CLI deploy command. - railway login - wasp-cli deploy railway launch "$APP_PREFIX" --workspace wasp "${ENV_VAR_ARGUMENTS[@]}" + wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_ID "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames From 7da3c8364ac48632ffb66b703ee4c74bd6b135ab Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 17:30:12 +0200 Subject: [PATCH 07/27] Use run_id instead of SHA --- .github/workflows/test-deploy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 0814a0b1b0..7d687c707c 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -14,7 +14,9 @@ on: workflow_dispatch: env: - APP_PREFIX: ci-${{ github.sha }} + # We use run_id becuase it's shorter than commit SHA since + # the max length for project name in Railway is 25 characters. + APP_PREFIX: ci-${{ github.run_id }} FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }} FLY_REGION: mia RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} From 800a3613d4e0cf3649420f9b6158897249af14ec Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 17:56:06 +0200 Subject: [PATCH 08/27] Test with Workspace name --- .github/workflows/test-deploy.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 7d687c707c..0ebade4de9 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -20,7 +20,7 @@ env: FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }} FLY_REGION: mia RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} - RAILWAY_WASP_WORKSPACE_ID: 22f3bf34-c18e-4846-92b9-efb42c23955e + RAILWAY_WASP_WORKSPACE_NAME: Wasp APP_TO_DEPLOY: waspc/examples/todoApp jobs: @@ -42,12 +42,15 @@ jobs: cache: "npm" node-version: "22" + # - name: Install Wasp CLI + # working-directory: waspc + # run: ./run install + - name: Install Wasp CLI - working-directory: waspc - run: ./run install + run: curl -sSL https://get.wasp.sh/installer.sh | sh -s - # NOTE: We tell users to install the latest version of Fly CLI, - # so we use it here too. + # NOTE: We tell users to install the latest version of Fly CLI, + # so we use it here too. - uses: superfly/flyctl-actions/setup-flyctl@v1 - name: Deploy App to Fly.io @@ -72,7 +75,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" + yes | wasp deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames @@ -172,7 +175,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_ID "${ENV_VAR_ARGUMENTS[@]}" + wasp deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames From db6c07924e2a5be9f5d2b6e9950b5ca1e652079a Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 18:13:06 +0200 Subject: [PATCH 09/27] Revert installing production Wasp CLI --- .github/workflows/test-deploy.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 0ebade4de9..a948734067 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -42,15 +42,12 @@ jobs: cache: "npm" node-version: "22" - # - name: Install Wasp CLI - # working-directory: waspc - # run: ./run install - - name: Install Wasp CLI - run: curl -sSL https://get.wasp.sh/installer.sh | sh -s + working-directory: waspc + run: ./run install - # NOTE: We tell users to install the latest version of Fly CLI, - # so we use it here too. + # NOTE: We tell users to install the latest version of Fly CLI, + # so we use it here too. - uses: superfly/flyctl-actions/setup-flyctl@v1 - name: Deploy App to Fly.io @@ -75,7 +72,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - yes | wasp deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" + yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames @@ -175,7 +172,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - wasp deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" + wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - name: Save deployed app hostnames id: save_hostnames From 80c359677d62ee7d6a2e5b1390d82aa206c68e9e Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 18:45:37 +0200 Subject: [PATCH 10/27] Add Railway app cleanup --- .github/workflows/test-deploy.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index a948734067..cef09c6bfd 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -174,7 +174,7 @@ jobs: # instead of passing it as a single string value). wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - - name: Save deployed app hostnames + - name: Save deployed app info id: save_hostnames working-directory: ${{ env.APP_TO_DEPLOY }} run: | @@ -183,9 +183,11 @@ jobs: echo "server_hostname=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" echo "client_hostname=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" + echo "project_id=$(railway status --json | jq -r '.id')" >> "$GITHUB_OUTPUT" outputs: server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }} client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }} + project_id: ${{ steps.save_hostnames.outputs.project_id }} railway_smoke_test_app: name: Run smoke tests on deployed app @@ -209,7 +211,7 @@ jobs: runs-on: ubuntu-latest name: Clean up deployed Railway app needs: [railway_deploy_app, railway_smoke_test_app] - # NOTE: Fly deployments can sometimes "fail" but still deploy the apps. We + # NOTE: Railway deployments can sometimes "fail" but still deploy the apps. We # want to always clean them up. if: always() @@ -224,4 +226,10 @@ jobs: - name: Clean up testing app from Railway run: | - echo "Not implemented yet, manually delete the project in Railway dashboard" + project_id=${{ needs.railway_deploy_app.outputs.project_id }} + + curl --request POST \ + --url https://backboard.railway.com/graphql/v2 \ + --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ + --header 'Content-Type: application/json' \ + --data "{\"query\":\"mutation projectDelete { projectDelete(id: \\\"$project_id\\\") }\"}" From 4b1f099b5c066cb0aa903fcd8f4e15631092f777 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 15 Sep 2025 18:50:39 +0200 Subject: [PATCH 11/27] Update jq and concurency --- .github/workflows/test-deploy.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index cef09c6bfd..98567c3f44 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -13,6 +13,10 @@ on: - v* workflow_dispatch: +concurrency: + group: test-deploy + cancel-in-progress: true + env: # We use run_id becuase it's shorter than commit SHA since # the max length for project name in Railway is 25 characters. @@ -97,7 +101,7 @@ jobs: steps: - name: Smoke test the server run: | - curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq '.json' + curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq -e '.json' - name: Smoke test the client run: | @@ -201,7 +205,7 @@ jobs: steps: - name: Smoke test the server run: | - curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq '.json' + curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq -e '.json' - name: Smoke test the client run: | From 5a8343c397cd8f13d78da587e2aac4cc63536548 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 09:40:53 +0200 Subject: [PATCH 12/27] Rewrite to use matrix --- .github/workflows/test-deploy.yaml | 197 ++++++++--------------------- 1 file changed, 55 insertions(+), 142 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 98567c3f44..9235f47bdc 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -28,13 +28,15 @@ env: APP_TO_DEPLOY: waspc/examples/todoApp jobs: - fly_deploy_app: - name: Deploy Wasp app to Fly.io - + test_deploy: + name: Deploy, test and cleanup (${{ matrix.provider }}) runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + provider: [fly, railway] environment: - name: fly-deploy-test + name: ${{ matrix.provider }}-deploy-test steps: - uses: actions/checkout@v4 @@ -52,9 +54,15 @@ jobs: # NOTE: We tell users to install the latest version of Fly CLI, # so we use it here too. - - uses: superfly/flyctl-actions/setup-flyctl@v1 + - name: Install Fly CLI + if: matrix.provider == 'fly' + uses: superfly/flyctl-actions/setup-flyctl@v1 - - name: Deploy App to Fly.io + - name: Install Railway CLI + if: matrix.provider == 'railway' + run: npm install -g @railway/cli + + - name: Deploy app working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e @@ -69,36 +77,40 @@ jobs: sed -E 's/^/--server-secret\n/' ) - echo "Deploying with prefix: $APP_PREFIX" - # NOTE: - # - The `yes` command is necessary because the `fly launch` command - # prompts for confirmation. - # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper - # word splitting (i.e., force Bash to interpret the flags separately - # instead of passing it as a single string value). - yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" - - - name: Save deployed app hostnames - id: save_hostnames + echo "Deploying with prefix: $APP_PREFIX (provider: ${{ matrix.provider }})" + + if [ "${{ matrix.provider }}" = "fly" ]; then + # NOTE: + # - The `yes` command is necessary because the `fly launch` command + # prompts for confirmation. + # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper + # word splitting (i.e., force Bash to interpret the flags separately + # instead of passing it as a single string value). + yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" + else + # NOTE: + # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper + # word splitting (i.e., force Bash to interpret the flags separately + # instead of passing it as a single string value). + wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" + fi + + - name: Save deployed app info + id: save_info working-directory: ${{ env.APP_TO_DEPLOY }} run: | - echo "server_hostname=$(flyctl status -j -c fly-server.toml | jq -r '.Hostname')" >> "$GITHUB_OUTPUT" - echo "client_hostname=$(flyctl status -j -c fly-client.toml | jq -r '.Hostname')" >> "$GITHUB_OUTPUT" - - outputs: - server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }} - client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }} - - fly_smoke_test_app: - name: Run smoke tests on deployed app - - runs-on: ubuntu-latest - needs: fly_deploy_app - env: - SERVER_HOSTNAME: ${{ needs.fly_deploy_app.outputs.server_hostname }} - CLIENT_HOSTNAME: ${{ needs.fly_deploy_app.outputs.client_hostname }} + if [ "${{ matrix.provider }}" = "fly" ]; then + echo "SERVER_HOSTNAME=$(flyctl status -j -c fly-server.toml | jq -r '.Hostname')" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(flyctl status -j -c fly-client.toml | jq -r '.Hostname')" >> "$GITHUB_ENV" + else + server_service_name="${APP_PREFIX}-server" + client_service_name="${APP_PREFIX}-client" + + echo "SERVER_HOSTNAME=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" + echo "PROJECT_ID=$(railway status --json | jq -r '.id')" >> "$GITHUB_ENV" + fi - steps: - name: Smoke test the server run: | curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq -e '.json' @@ -107,16 +119,9 @@ jobs: run: | curl --fail --silent https://$CLIENT_HOSTNAME | grep 'ToDo App' - fly_destroy_app: - runs-on: ubuntu-latest - name: Clean up deployed Fly app - needs: [fly_deploy_app, fly_smoke_test_app] - # NOTE: Fly deployments can sometimes "fail" but still deploy the apps. We - # want to always clean them up. - if: always() - - steps: - - uses: superfly/flyctl-actions/setup-flyctl@v1 + - name: Prepare Fly CLI for cleanup + if: always() && matrix.provider == 'fly' + uses: superfly/flyctl-actions/setup-flyctl@v1 with: # NOTE: We pinned the Fly because we don't want the changes in the # Fly CLI to affect our cleanup procedure. `fly destroy` isn't a part @@ -124,113 +129,21 @@ jobs: version: v0.3.164 - name: Clean up testing app from Fly.io + if: always() && matrix.provider == 'fly' run: | # NOTE: We are relying on Wasp's naming conventions here flyctl apps destroy -y $APP_PREFIX-server || true flyctl apps destroy -y $APP_PREFIX-client || true flyctl apps destroy -y $APP_PREFIX-db || true - railway_deploy_app: - name: Deploy Wasp app to Railway - - runs-on: ubuntu-latest - - environment: - name: railway-deploy-test - - steps: - - uses: actions/checkout@v4 - - - uses: ./.github/actions/setup-haskell - - - uses: actions/setup-node@v4 - with: - cache: "npm" - node-version: "22" - - - name: Install Wasp CLI - working-directory: waspc - run: ./run install - - - name: Install Railway CLI - run: | - npm install -g @railway/cli - - - name: Deploy App to Railway - working-directory: ${{ env.APP_TO_DEPLOY }} - run: | - set -e - - # NOTE: This assumes env var values don't contain: - # - The character `#`. - # - An empty line (i.e., there are no multiline env values). - mapfile -t ENV_VAR_ARGUMENTS < <( - cat .env.server.example | - sed -E 's/#.*//' | - awk 'NF {$1=$1;print}' | - sed -E 's/^/--server-secret\n/' - ) - - echo "Deploying with prefix: $APP_PREFIX" - # NOTE: - # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper - # word splitting (i.e., force Bash to interpret the flags separately - # instead of passing it as a single string value). - wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - - - name: Save deployed app info - id: save_hostnames - working-directory: ${{ env.APP_TO_DEPLOY }} - run: | - server_service_name="${APP_PREFIX}-server" - client_service_name="${APP_PREFIX}-client" - - echo "server_hostname=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" - echo "client_hostname=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_OUTPUT" - echo "project_id=$(railway status --json | jq -r '.id')" >> "$GITHUB_OUTPUT" - outputs: - server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }} - client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }} - project_id: ${{ steps.save_hostnames.outputs.project_id }} - - railway_smoke_test_app: - name: Run smoke tests on deployed app - - runs-on: ubuntu-latest - needs: railway_deploy_app - env: - SERVER_HOSTNAME: ${{ needs.railway_deploy_app.outputs.server_hostname }} - CLIENT_HOSTNAME: ${{ needs.railway_deploy_app.outputs.client_hostname }} - - steps: - - name: Smoke test the server - run: | - curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq -e '.json' - - - name: Smoke test the client - run: | - curl --fail --silent https://$CLIENT_HOSTNAME | grep 'ToDo App' - - railway_destroy_app: - runs-on: ubuntu-latest - name: Clean up deployed Railway app - needs: [railway_deploy_app, railway_smoke_test_app] - # NOTE: Railway deployments can sometimes "fail" but still deploy the apps. We - # want to always clean them up. - if: always() - - steps: - - uses: actions/setup-node@v4 - with: - node-version: "22" - - - name: Install Railway CLI - run: | - npm install -g @railway/cli + - name: Prepare Railway CLI for cleanup + if: always() && matrix.provider == 'railway' + run: npm install -g @railway/cli - name: Clean up testing app from Railway + if: always() && matrix.provider == 'railway' run: | - project_id=${{ needs.railway_deploy_app.outputs.project_id }} + project_id=$PROJECT_ID curl --request POST \ --url https://backboard.railway.com/graphql/v2 \ From b21a2361e74add5bac783728c6a8e76452b9bc8d Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 09:52:36 +0200 Subject: [PATCH 13/27] Make Railway cleanup more robust --- .github/workflows/test-deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 9235f47bdc..57349ce3ad 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -108,7 +108,6 @@ jobs: echo "SERVER_HOSTNAME=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" echo "CLIENT_HOSTNAME=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" - echo "PROJECT_ID=$(railway status --json | jq -r '.id')" >> "$GITHUB_ENV" fi - name: Smoke test the server @@ -143,7 +142,8 @@ jobs: - name: Clean up testing app from Railway if: always() && matrix.provider == 'railway' run: | - project_id=$PROJECT_ID + project_id=$(railway status --json | jq -r '.id') + curl --request POST \ --url https://backboard.railway.com/graphql/v2 \ From 648848aca2066eb117856100bfe2c01180c7eff7 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 10:56:53 +0200 Subject: [PATCH 14/27] Add retries for smoke tests --- .github/workflows/test-deploy.yaml | 14 +---- scripts/smoke-test-deployed-test-app.sh | 77 +++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 11 deletions(-) create mode 100755 scripts/smoke-test-deployed-test-app.sh diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 57349ce3ad..384daae06d 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -110,13 +110,8 @@ jobs: echo "CLIENT_HOSTNAME=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" fi - - name: Smoke test the server - run: | - curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date | jq -e '.json' - - - name: Smoke test the client - run: | - curl --fail --silent https://$CLIENT_HOSTNAME | grep 'ToDo App' + - name: Smoke test deployed app + run: ./scripts/smoke-test-deployed-test-app.sh "$SERVER_HOSTNAME" "$CLIENT_HOSTNAME" - name: Prepare Fly CLI for cleanup if: always() && matrix.provider == 'fly' @@ -135,12 +130,9 @@ jobs: flyctl apps destroy -y $APP_PREFIX-client || true flyctl apps destroy -y $APP_PREFIX-db || true - - name: Prepare Railway CLI for cleanup - if: always() && matrix.provider == 'railway' - run: npm install -g @railway/cli - - name: Clean up testing app from Railway if: always() && matrix.provider == 'railway' + working-directory: ${{ env.APP_TO_DEPLOY }} run: | project_id=$(railway status --json | jq -r '.id') diff --git a/scripts/smoke-test-deployed-test-app.sh b/scripts/smoke-test-deployed-test-app.sh new file mode 100755 index 0000000000..54b6d090de --- /dev/null +++ b/scripts/smoke-test-deployed-test-app.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -euo pipefail + +MAX_RETRIES=5 +INITIAL_WAIT_SECONDS=2 +TIMEOUT_SECONDS=30 + +usage() { + echo "Usage: $0 " +} + +if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then + usage + exit 0 +fi + +if [[ $# -ne 2 ]]; then + echo "Error: Missing required arguments" + usage + exit 1 +fi + +SERVER_HOSTNAME="$1" +CLIENT_HOSTNAME="$2" +SERVER_URL="https://$SERVER_HOSTNAME" +CLIENT_URL="https://$CLIENT_HOSTNAME" + +retry_with_backoff() { + local name="$1"; shift + local attempt=0 + local wait_time=0 + while [[ $attempt -lt $MAX_RETRIES ]]; do + echo "[$name] Attempt $((attempt + 1))/$MAX_RETRIES at $(date -u +'%H:%M:%S')" + if "$@"; then + echo "[$name] Success" + return 0 + fi + attempt=$((attempt + 1)) + if [[ $attempt -lt $MAX_RETRIES ]]; then + wait_time=$(( INITIAL_WAIT_SECONDS * (2 ** (attempt - 1)) )) + echo "[$name] Waiting ${wait_time}s before retry..." + sleep "$wait_time" + else + echo "[$name] Failed after $MAX_RETRIES attempts" + return 1 + fi + done +} + +server_check_once() { + echo "[Server] Hitting $SERVER_URL/operations/get-date" + curl --fail --silent --max-time "$TIMEOUT_SECONDS" -X POST \ + "$SERVER_URL/operations/get-date" \ + | jq -e '.json' > /dev/null +} + +client_check_once() { + echo "[Client] Hitting $CLIENT_URL" + curl --fail --silent --max-time "$TIMEOUT_SECONDS" \ + "$CLIENT_URL" \ + | grep -q 'ToDo App' +} + +echo "Server URL: $SERVER_URL" +echo "Client URL: $CLIENT_URL" + +if ! retry_with_backoff "Server" server_check_once; then + echo "Server smoke test failed" + exit 1 +fi + +if ! retry_with_backoff "Client" client_check_once; then + echo "Client smoke test failed" + exit 1 +fi + +echo "All smoke tests passed" \ No newline at end of file From d2bb57ae3680936152197f1b72242b763cb74662 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 10:58:29 +0200 Subject: [PATCH 15/27] Format --- .github/workflows/test-deploy.yaml | 1 - scripts/smoke-test-deployed-test-app.sh | 77 +++++++++++++------------ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 384daae06d..cd71221ef8 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -136,7 +136,6 @@ jobs: run: | project_id=$(railway status --json | jq -r '.id') - curl --request POST \ --url https://backboard.railway.com/graphql/v2 \ --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ diff --git a/scripts/smoke-test-deployed-test-app.sh b/scripts/smoke-test-deployed-test-app.sh index 54b6d090de..9575286a87 100755 --- a/scripts/smoke-test-deployed-test-app.sh +++ b/scripts/smoke-test-deployed-test-app.sh @@ -6,18 +6,18 @@ INITIAL_WAIT_SECONDS=2 TIMEOUT_SECONDS=30 usage() { - echo "Usage: $0 " + echo "Usage: $0 " } if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then - usage - exit 0 + usage + exit 0 fi if [[ $# -ne 2 ]]; then - echo "Error: Missing required arguments" - usage - exit 1 + echo "Error: Missing required arguments" + usage + exit 1 fi SERVER_HOSTNAME="$1" @@ -26,52 +26,53 @@ SERVER_URL="https://$SERVER_HOSTNAME" CLIENT_URL="https://$CLIENT_HOSTNAME" retry_with_backoff() { - local name="$1"; shift - local attempt=0 - local wait_time=0 - while [[ $attempt -lt $MAX_RETRIES ]]; do - echo "[$name] Attempt $((attempt + 1))/$MAX_RETRIES at $(date -u +'%H:%M:%S')" - if "$@"; then - echo "[$name] Success" - return 0 - fi - attempt=$((attempt + 1)) - if [[ $attempt -lt $MAX_RETRIES ]]; then - wait_time=$(( INITIAL_WAIT_SECONDS * (2 ** (attempt - 1)) )) - echo "[$name] Waiting ${wait_time}s before retry..." - sleep "$wait_time" - else - echo "[$name] Failed after $MAX_RETRIES attempts" - return 1 - fi - done + local name="$1" + shift + local attempt=0 + local wait_time=0 + while [[ $attempt -lt $MAX_RETRIES ]]; do + echo "[$name] Attempt $((attempt + 1))/$MAX_RETRIES at $(date -u +'%H:%M:%S')" + if "$@"; then + echo "[$name] Success" + return 0 + fi + attempt=$((attempt + 1)) + if [[ $attempt -lt $MAX_RETRIES ]]; then + wait_time=$((INITIAL_WAIT_SECONDS * (2 ** (attempt - 1)))) + echo "[$name] Waiting ${wait_time}s before retry..." + sleep "$wait_time" + else + echo "[$name] Failed after $MAX_RETRIES attempts" + return 1 + fi + done } server_check_once() { - echo "[Server] Hitting $SERVER_URL/operations/get-date" - curl --fail --silent --max-time "$TIMEOUT_SECONDS" -X POST \ - "$SERVER_URL/operations/get-date" \ - | jq -e '.json' > /dev/null + echo "[Server] Hitting $SERVER_URL/operations/get-date" + curl --fail --silent --max-time "$TIMEOUT_SECONDS" -X POST \ + "$SERVER_URL/operations/get-date" \ + | jq -e '.json' > /dev/null } client_check_once() { - echo "[Client] Hitting $CLIENT_URL" - curl --fail --silent --max-time "$TIMEOUT_SECONDS" \ - "$CLIENT_URL" \ - | grep -q 'ToDo App' + echo "[Client] Hitting $CLIENT_URL" + curl --fail --silent --max-time "$TIMEOUT_SECONDS" \ + "$CLIENT_URL" \ + | grep -q 'ToDo App' } echo "Server URL: $SERVER_URL" echo "Client URL: $CLIENT_URL" if ! retry_with_backoff "Server" server_check_once; then - echo "Server smoke test failed" - exit 1 + echo "Server smoke test failed" + exit 1 fi if ! retry_with_backoff "Client" client_check_once; then - echo "Client smoke test failed" - exit 1 + echo "Client smoke test failed" + exit 1 fi -echo "All smoke tests passed" \ No newline at end of file +echo "All smoke tests passed" From 9f0aba48144adf9f776ff5aa4d56828bb45765c0 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 11:54:00 +0200 Subject: [PATCH 16/27] Show output of the smoke tests --- scripts/smoke-test-deployed-test-app.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/smoke-test-deployed-test-app.sh b/scripts/smoke-test-deployed-test-app.sh index 9575286a87..caea93d1c0 100755 --- a/scripts/smoke-test-deployed-test-app.sh +++ b/scripts/smoke-test-deployed-test-app.sh @@ -52,14 +52,14 @@ server_check_once() { echo "[Server] Hitting $SERVER_URL/operations/get-date" curl --fail --silent --max-time "$TIMEOUT_SECONDS" -X POST \ "$SERVER_URL/operations/get-date" \ - | jq -e '.json' > /dev/null + | jq -e '.json' } client_check_once() { echo "[Client] Hitting $CLIENT_URL" curl --fail --silent --max-time "$TIMEOUT_SECONDS" \ "$CLIENT_URL" \ - | grep -q 'ToDo App' + | grep 'ToDo App' } echo "Server URL: $SERVER_URL" From b1532c834d2478c4fd5a0d95298aeeab734473ab Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Tue, 16 Sep 2025 12:20:32 +0200 Subject: [PATCH 17/27] DRY getting hostnames --- .github/workflows/test-deploy.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index cd71221ef8..01e79f8abd 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -99,15 +99,25 @@ jobs: id: save_info working-directory: ${{ env.APP_TO_DEPLOY }} run: | + function get_fly_app_hostname() { + config_file="$1" + flyctl status -j -c "$config_file" | jq -r '.Hostname' + } + + function get_railway_service_hostname() { + service_name="$1" + railway status --json | jq -r --arg NAME "$service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain' + } + if [ "${{ matrix.provider }}" = "fly" ]; then - echo "SERVER_HOSTNAME=$(flyctl status -j -c fly-server.toml | jq -r '.Hostname')" >> "$GITHUB_ENV" - echo "CLIENT_HOSTNAME=$(flyctl status -j -c fly-client.toml | jq -r '.Hostname')" >> "$GITHUB_ENV" + echo "SERVER_HOSTNAME=$(get_fly_app_hostname fly-server.toml)" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(get_fly_app_hostname fly-client.toml)" >> "$GITHUB_ENV" else server_service_name="${APP_PREFIX}-server" client_service_name="${APP_PREFIX}-client" - echo "SERVER_HOSTNAME=$(railway status --json | jq -r --arg NAME "$server_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" - echo "CLIENT_HOSTNAME=$(railway status --json | jq -r --arg NAME "$client_service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain')" >> "$GITHUB_ENV" + echo "SERVER_HOSTNAME=$(get_railway_service_hostname "$server_service_name")" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(get_railway_service_hostname "$client_service_name")" >> "$GITHUB_ENV" fi - name: Smoke test deployed app From 5d2df2dac2929f0874c153033b541b9a5660a708 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Wed, 17 Sep 2025 11:57:37 +0200 Subject: [PATCH 18/27] Cleanup --- .github/workflows/test-deploy.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 01e79f8abd..2ce41c3cbd 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -13,16 +13,13 @@ on: - v* workflow_dispatch: -concurrency: - group: test-deploy - cancel-in-progress: true - env: # We use run_id becuase it's shorter than commit SHA since # the max length for project name in Railway is 25 characters. APP_PREFIX: ci-${{ github.run_id }} FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }} FLY_REGION: mia + FLY_ORG: wasp-testing RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} RAILWAY_WASP_WORKSPACE_NAME: Wasp APP_TO_DEPLOY: waspc/examples/todoApp @@ -64,6 +61,7 @@ jobs: - name: Deploy app working-directory: ${{ env.APP_TO_DEPLOY }} + shell: bash run: | set -e @@ -86,7 +84,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org wasp-testing "${ENV_VAR_ARGUMENTS[@]}" + yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" else # NOTE: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper @@ -97,8 +95,11 @@ jobs: - name: Save deployed app info id: save_info + shell: bash working-directory: ${{ env.APP_TO_DEPLOY }} run: | + set -e + function get_fly_app_hostname() { config_file="$1" flyctl status -j -c "$config_file" | jq -r '.Hostname' From b2d5c5dd64e5d8325c20c81c42cd7ddd553a4fa2 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Wed, 17 Sep 2025 14:00:29 +0200 Subject: [PATCH 19/27] Ignore `yes` errors --- .github/workflows/test-deploy.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 2ce41c3cbd..2598da6547 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -81,10 +81,13 @@ jobs: # NOTE: # - The `yes` command is necessary because the `fly launch` command # prompts for confirmation. + # - We ignore any error from `yes` because it will terminate + # with a `SIGPIPE` when `fly launch` consumes enough input and + # exits, which is expected behavior. # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" + yes 2>/dev/null | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" else # NOTE: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper From a18dee1eeb736ce6ecc078a42f1a7cdf4d0a2925 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Wed, 17 Sep 2025 14:32:27 +0200 Subject: [PATCH 20/27] Revert using bash shell --- .github/workflows/test-deploy.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 2598da6547..be24f6cbde 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -61,7 +61,6 @@ jobs: - name: Deploy app working-directory: ${{ env.APP_TO_DEPLOY }} - shell: bash run: | set -e @@ -87,7 +86,7 @@ jobs: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper # word splitting (i.e., force Bash to interpret the flags separately # instead of passing it as a single string value). - yes 2>/dev/null | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" + yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" else # NOTE: # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper @@ -98,7 +97,6 @@ jobs: - name: Save deployed app info id: save_info - shell: bash working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e From 9fb74991a8c355620f951f10cafab5b0777fbe2c Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 11:21:51 +0200 Subject: [PATCH 21/27] Testing job split --- .github/workflows/test-deploy.yaml | 161 ++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 47 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index be24f6cbde..dbb0e04bc6 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -23,10 +23,12 @@ env: RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} RAILWAY_WASP_WORKSPACE_NAME: Wasp APP_TO_DEPLOY: waspc/examples/todoApp + DEPLOY_INFO_DIR: /tmp/deploy-info + CACHE_KEY_PREFIX: deploy-info jobs: - test_deploy: - name: Deploy, test and cleanup (${{ matrix.provider }}) + deploy_app: + name: Deploy app (${{ matrix.provider }}) runs-on: ubuntu-latest strategy: fail-fast: false @@ -49,8 +51,6 @@ jobs: working-directory: waspc run: ./run install - # NOTE: We tell users to install the latest version of Fly CLI, - # so we use it here too. - name: Install Fly CLI if: matrix.provider == 'fly' uses: superfly/flyctl-actions/setup-flyctl@v1 @@ -59,11 +59,10 @@ jobs: if: matrix.provider == 'railway' run: npm install -g @railway/cli - - name: Deploy app + - name: Prepare environment variables working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e - # NOTE: This assumes env var values don't contain: # - The character `#`. # - An empty line (i.e., there are no multiline env values). @@ -73,60 +72,107 @@ jobs: awk 'NF {$1=$1;print}' | sed -E 's/^/--server-secret\n/' ) + echo "ENV_VAR_ARGUMENTS=${ENV_VAR_ARGUMENTS[*]}" >> "$GITHUB_ENV" - echo "Deploying with prefix: $APP_PREFIX (provider: ${{ matrix.provider }})" - - if [ "${{ matrix.provider }}" = "fly" ]; then - # NOTE: - # - The `yes` command is necessary because the `fly launch` command - # prompts for confirmation. - # - We ignore any error from `yes` because it will terminate - # with a `SIGPIPE` when `fly launch` consumes enough input and - # exits, which is expected behavior. - # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper - # word splitting (i.e., force Bash to interpret the flags separately - # instead of passing it as a single string value). - yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" - else - # NOTE: - # - We use a Bash array for `$ENV_VAR_ARGUMENTS` to ensure proper - # word splitting (i.e., force Bash to interpret the flags separately - # instead of passing it as a single string value). - wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - fi + - name: Deploy app to Fly + if: matrix.provider == 'fly' + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + set -e + echo "Deploying with prefix: $APP_PREFIX (provider: fly)" + mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') + yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" - - name: Save deployed app info - id: save_info + - name: Deploy app to Railway + if: matrix.provider == 'railway' working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e + echo "Deploying with prefix: $APP_PREFIX (provider: railway)" + mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') + wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" + - name: Get deployed app hostnames (Fly) + if: matrix.provider == 'fly' + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + set -e function get_fly_app_hostname() { config_file="$1" flyctl status -j -c "$config_file" | jq -r '.Hostname' } + echo "SERVER_HOSTNAME=$(get_fly_app_hostname fly-server.toml)" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(get_fly_app_hostname fly-client.toml)" >> "$GITHUB_ENV" + - name: Get deployed app hostnames (Railway) + if: matrix.provider == 'railway' + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + set -e function get_railway_service_hostname() { service_name="$1" railway status --json | jq -r --arg NAME "$service_name" '.services.edges[] | select(.node.name == $NAME) | .node.serviceInstances.edges[0].node.domains.serviceDomains[0].domain' } + server_service_name="${APP_PREFIX}-server" + client_service_name="${APP_PREFIX}-client" + echo "SERVER_HOSTNAME=$(get_railway_service_hostname "$server_service_name")" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(get_railway_service_hostname "$client_service_name")" >> "$GITHUB_ENV" - if [ "${{ matrix.provider }}" = "fly" ]; then - echo "SERVER_HOSTNAME=$(get_fly_app_hostname fly-server.toml)" >> "$GITHUB_ENV" - echo "CLIENT_HOSTNAME=$(get_fly_app_hostname fly-client.toml)" >> "$GITHUB_ENV" - else - server_service_name="${APP_PREFIX}-server" - client_service_name="${APP_PREFIX}-client" + - name: Save deployment info to cache + run: | + set -e + mkdir -p "$DEPLOY_INFO_DIR" + echo "$SERVER_HOSTNAME" > "$DEPLOY_INFO_DIR/server-hostname" + echo "$CLIENT_HOSTNAME" > "$DEPLOY_INFO_DIR/client-hostname" - echo "SERVER_HOSTNAME=$(get_railway_service_hostname "$server_service_name")" >> "$GITHUB_ENV" - echo "CLIENT_HOSTNAME=$(get_railway_service_hostname "$client_service_name")" >> "$GITHUB_ENV" - fi + - name: Cache deployment info + uses: actions/cache/save@v4 + with: + path: ${{ env.DEPLOY_INFO_DIR }} + key: ${{ env.CACHE_KEY_PREFIX }}-${{ matrix.provider }}-${{ github.run_id }} + + smoke_test_app: + name: Smoke test app (${{ matrix.provider }}) + runs-on: ubuntu-latest + needs: deploy_app + strategy: + fail-fast: false + matrix: + provider: [fly, railway] + + steps: + - uses: actions/checkout@v4 + + - name: Restore deployment info + uses: actions/cache/restore@v4 + with: + path: ${{ env.DEPLOY_INFO_DIR }} + key: ${{ env.CACHE_KEY_PREFIX }}-${{ matrix.provider }}-${{ github.run_id }} + + - name: Load hostnames from cache + run: | + set -e + echo "SERVER_HOSTNAME=$(cat "$DEPLOY_INFO_DIR/server-hostname")" >> "$GITHUB_ENV" + echo "CLIENT_HOSTNAME=$(cat "$DEPLOY_INFO_DIR/client-hostname")" >> "$GITHUB_ENV" - name: Smoke test deployed app run: ./scripts/smoke-test-deployed-test-app.sh "$SERVER_HOSTNAME" "$CLIENT_HOSTNAME" + cleanup: + name: Cleanup app (${{ matrix.provider }}) + runs-on: ubuntu-latest + if: always() + needs: [deploy_app, smoke_test_app] + strategy: + fail-fast: false + matrix: + provider: [fly, railway] + + steps: + - uses: actions/checkout@v4 + - name: Prepare Fly CLI for cleanup - if: always() && matrix.provider == 'fly' + if: matrix.provider == 'fly' uses: superfly/flyctl-actions/setup-flyctl@v1 with: # NOTE: We pinned the Fly because we don't want the changes in the @@ -135,7 +181,7 @@ jobs: version: v0.3.164 - name: Clean up testing app from Fly.io - if: always() && matrix.provider == 'fly' + if: matrix.provider == 'fly' run: | # NOTE: We are relying on Wasp's naming conventions here flyctl apps destroy -y $APP_PREFIX-server || true @@ -143,13 +189,34 @@ jobs: flyctl apps destroy -y $APP_PREFIX-db || true - name: Clean up testing app from Railway - if: always() && matrix.provider == 'railway' - working-directory: ${{ env.APP_TO_DEPLOY }} + if: matrix.provider == 'railway' run: | - project_id=$(railway status --json | jq -r '.id') + set -e - curl --request POST \ - --url https://backboard.railway.com/graphql/v2 \ - --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ - --header 'Content-Type: application/json' \ - --data "{\"query\":\"mutation projectDelete { projectDelete(id: \\\"$project_id\\\") }\"}" + function get_railway_project_id() { + local project_name="$1" + curl --silent --request POST \ + --url https://backboard.railway.com/graphql/v2 \ + --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ + --header 'Content-Type: application/json' \ + --data "{\"query\":\"query { me { projects { edges { node { id name } } } } }\"}" | \ + jq -r --arg PROJECT_NAME "$project_name" '.data.me.projects.edges[] | select(.node.name == $PROJECT_NAME) | .node.id' + } + + function delete_railway_project() { + local project_id="$1" + curl --request POST \ + --url https://backboard.railway.com/graphql/v2 \ + --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ + --header 'Content-Type: application/json' \ + --data "{\"query\":\"mutation { projectDelete(id: \\\"$project_id\\\") }\"}" + } + + project_id=$(get_railway_project_id "$APP_PREFIX") + + if [ -n "$project_id" ] && [ "$project_id" != "null" ]; then + echo "Found project $APP_PREFIX with ID: $project_id" + delete_railway_project "$project_id" + else + echo "Project $APP_PREFIX not found, skipping cleanup" + fi From 3454f9d5924e8dbe753721db240869f0d6af6ceb Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 11:56:12 +0200 Subject: [PATCH 22/27] Dumb down env var processing --- .github/workflows/test-deploy.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index dbb0e04bc6..d47e3b2ec8 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -59,10 +59,12 @@ jobs: if: matrix.provider == 'railway' run: npm install -g @railway/cli - - name: Prepare environment variables + - name: Deploy app to Fly + if: matrix.provider == 'fly' working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e + # NOTE: This assumes env var values don't contain: # - The character `#`. # - An empty line (i.e., there are no multiline env values). @@ -72,13 +74,7 @@ jobs: awk 'NF {$1=$1;print}' | sed -E 's/^/--server-secret\n/' ) - echo "ENV_VAR_ARGUMENTS=${ENV_VAR_ARGUMENTS[*]}" >> "$GITHUB_ENV" - - name: Deploy app to Fly - if: matrix.provider == 'fly' - working-directory: ${{ env.APP_TO_DEPLOY }} - run: | - set -e echo "Deploying with prefix: $APP_PREFIX (provider: fly)" mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" @@ -88,6 +84,17 @@ jobs: working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e + + # NOTE: This assumes env var values don't contain: + # - The character `#`. + # - An empty line (i.e., there are no multiline env values). + mapfile -t ENV_VAR_ARGUMENTS < <( + cat .env.server.example | + sed -E 's/#.*//' | + awk 'NF {$1=$1;print}' | + sed -E 's/^/--server-secret\n/' + ) + echo "Deploying with prefix: $APP_PREFIX (provider: railway)" mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" From 7cdef81b33af2a589cde435ff52382a67ea30ef8 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 12:03:56 +0200 Subject: [PATCH 23/27] Try a different env vars approach --- .github/workflows/test-deploy.yaml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index d47e3b2ec8..8e0634dfae 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -59,12 +59,10 @@ jobs: if: matrix.provider == 'railway' run: npm install -g @railway/cli - - name: Deploy app to Fly - if: matrix.provider == 'fly' + - name: Prepare env variables working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e - # NOTE: This assumes env var values don't contain: # - The character `#`. # - An empty line (i.e., there are no multiline env values). @@ -74,9 +72,16 @@ jobs: awk 'NF {$1=$1;print}' | sed -E 's/^/--server-secret\n/' ) + # Save into a file so that subsequent steps can use it. + printf '%s\n' "${ENV_VAR_ARGUMENTS[@]}" > .env-args.txt + - name: Deploy app to Fly + if: matrix.provider == 'fly' + working-directory: ${{ env.APP_TO_DEPLOY }} + run: | + set -e echo "Deploying with prefix: $APP_PREFIX (provider: fly)" - mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') + mapfile -t ENV_VAR_ARGUMENTS < .env-args.txt yes | wasp-cli deploy fly launch "$APP_PREFIX" "$FLY_REGION" --org "$FLY_ORG" "${ENV_VAR_ARGUMENTS[@]}" - name: Deploy app to Railway @@ -84,19 +89,8 @@ jobs: working-directory: ${{ env.APP_TO_DEPLOY }} run: | set -e - - # NOTE: This assumes env var values don't contain: - # - The character `#`. - # - An empty line (i.e., there are no multiline env values). - mapfile -t ENV_VAR_ARGUMENTS < <( - cat .env.server.example | - sed -E 's/#.*//' | - awk 'NF {$1=$1;print}' | - sed -E 's/^/--server-secret\n/' - ) - echo "Deploying with prefix: $APP_PREFIX (provider: railway)" - mapfile -t ENV_VAR_ARGUMENTS < <(echo "$ENV_VAR_ARGUMENTS" | tr ' ' '\n') + mapfile -t ENV_VAR_ARGUMENTS < .env-args.txt wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" - name: Get deployed app hostnames (Fly) From af5ac9e5aba6882a5efe9aec8346be3755b96d6d Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 12:53:26 +0200 Subject: [PATCH 24/27] Use correct Railway GraphQL query to get the project ID --- .github/workflows/test-deploy.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 8e0634dfae..aa46ec6498 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -22,6 +22,7 @@ env: FLY_ORG: wasp-testing RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} RAILWAY_WASP_WORKSPACE_NAME: Wasp + RAILWAY_WASP_WORKSPACE_ID: eb1f9060-40c8-4be0-a372-3a8c9b8bdcf2 APP_TO_DEPLOY: waspc/examples/todoApp DEPLOY_INFO_DIR: /tmp/deploy-info CACHE_KEY_PREFIX: deploy-info @@ -200,8 +201,8 @@ jobs: --url https://backboard.railway.com/graphql/v2 \ --header "Authorization: Bearer $RAILWAY_API_TOKEN" \ --header 'Content-Type: application/json' \ - --data "{\"query\":\"query { me { projects { edges { node { id name } } } } }\"}" | \ - jq -r --arg PROJECT_NAME "$project_name" '.data.me.projects.edges[] | select(.node.name == $PROJECT_NAME) | .node.id' + --data "{\"query\":\"query { workspace(workspaceId: \\\"$RAILWAY_WASP_WORKSPACE_ID\\\") { projects { edges { node { id name } } } } }\"}" | \ + jq -r --arg PROJECT_NAME "$project_name" '.data.workspace.projects.edges[] | select(.node.name == $PROJECT_NAME) | .node.id' } function delete_railway_project() { From cd71c8dc43078efe01ee4dabf87d6325b517019b Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 13:26:59 +0200 Subject: [PATCH 25/27] Use workspace ID instead of name --- .github/workflows/test-deploy.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index aa46ec6498..8642cba11d 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -21,7 +21,6 @@ env: FLY_REGION: mia FLY_ORG: wasp-testing RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_GITHUB_TESTING_TOKEN }} - RAILWAY_WASP_WORKSPACE_NAME: Wasp RAILWAY_WASP_WORKSPACE_ID: eb1f9060-40c8-4be0-a372-3a8c9b8bdcf2 APP_TO_DEPLOY: waspc/examples/todoApp DEPLOY_INFO_DIR: /tmp/deploy-info @@ -92,7 +91,7 @@ jobs: set -e echo "Deploying with prefix: $APP_PREFIX (provider: railway)" mapfile -t ENV_VAR_ARGUMENTS < .env-args.txt - wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_NAME "${ENV_VAR_ARGUMENTS[@]}" + wasp-cli deploy railway launch "$APP_PREFIX" --workspace $RAILWAY_WASP_WORKSPACE_ID "${ENV_VAR_ARGUMENTS[@]}" - name: Get deployed app hostnames (Fly) if: matrix.provider == 'fly' From d88cd0fbbb6bbf1164f7cd8df7b64e32b6f08691 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 18 Sep 2025 16:40:37 +0200 Subject: [PATCH 26/27] Bump the wait time for smoke test --- scripts/smoke-test-deployed-test-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/smoke-test-deployed-test-app.sh b/scripts/smoke-test-deployed-test-app.sh index caea93d1c0..4c92fe00a1 100755 --- a/scripts/smoke-test-deployed-test-app.sh +++ b/scripts/smoke-test-deployed-test-app.sh @@ -2,7 +2,7 @@ set -euo pipefail MAX_RETRIES=5 -INITIAL_WAIT_SECONDS=2 +INITIAL_WAIT_SECONDS=10 TIMEOUT_SECONDS=30 usage() { From e8e99315e57df0664576c723380c0ed78fcc485e Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Mon, 6 Oct 2025 16:42:01 +0200 Subject: [PATCH 27/27] Update .github/workflows/test-deploy.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/test-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-deploy.yaml b/.github/workflows/test-deploy.yaml index 8642cba11d..67757387a9 100644 --- a/.github/workflows/test-deploy.yaml +++ b/.github/workflows/test-deploy.yaml @@ -14,7 +14,7 @@ on: workflow_dispatch: env: - # We use run_id becuase it's shorter than commit SHA since + # We use run_id because it's shorter than commit SHA since # the max length for project name in Railway is 25 characters. APP_PREFIX: ci-${{ github.run_id }} FLY_API_TOKEN: ${{ secrets.FLY_GITHUB_TESTING_TOKEN }}