Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f14b535
Create workflow skeleton
sodic Jul 16, 2025
f948bc6
Fix typo
sodic Jul 16, 2025
2d9a400
Try without required secret
sodic Jul 16, 2025
8329be6
Remove quotes around secret
sodic Jul 16, 2025
d95b7f4
Try another thing with secrets
sodic Jul 16, 2025
81b9269
Fix error in yaml
sodic Jul 16, 2025
d0d8a75
Add runs on
sodic Jul 16, 2025
e609cbb
Misspell secret
sodic Jul 16, 2025
e78355a
Mitigate misspell to work
sodic Jul 16, 2025
6f3970a
WIP
sodic Jul 16, 2025
c4fe748
WIP
sodic Jul 16, 2025
8fc51ae
WIP
sodic Jul 16, 2025
ea6af0d
Make some changes
sodic Jul 16, 2025
f7703e1
Start working on prefixes
sodic Jul 16, 2025
b920559
WIP
sodic Jul 16, 2025
43454b6
WIP
sodic Jul 16, 2025
e367432
WIP
sodic Jul 16, 2025
519ef56
WIP
sodic Jul 16, 2025
a796bc4
WIP
sodic Jul 16, 2025
71ba834
WIP
sodic Jul 17, 2025
6153bd6
WIP
sodic Jul 17, 2025
0a5ed91
WIP
sodic Jul 17, 2025
334a37f
WIP
sodic Jul 17, 2025
4cd04bc
WIP
sodic Jul 17, 2025
da1bcba
WIP
sodic Jul 17, 2025
718b3fe
WIP
sodic Jul 17, 2025
638b452
WIP
sodic Jul 17, 2025
9fff48f
WIP
sodic Jul 17, 2025
7027e38
WIP
sodic Jul 17, 2025
e2b5e84
WIP
sodic Jul 17, 2025
87dc61a
WIP
sodic Jul 17, 2025
c6fde18
WIP
sodic Jul 17, 2025
27fc2e2
WIP
sodic Jul 17, 2025
6f9296c
WIP
sodic Jul 17, 2025
d1fd380
WIP
sodic Jul 17, 2025
b9dcdae
WIP
sodic Jul 17, 2025
b328744
WIP
sodic Jul 17, 2025
be2f08e
WIP
sodic Jul 17, 2025
edde373
WIP
sodic Jul 17, 2025
7b2c208
WIP
sodic Jul 17, 2025
bee0c6b
WIP
sodic Jul 17, 2025
e06df99
WIP
sodic Jul 17, 2025
7484319
WIP
sodic Jul 17, 2025
72bf304
WIP
sodic Jul 17, 2025
b6137fe
WIP
sodic Jul 17, 2025
3111546
WIP
sodic Jul 17, 2025
a351500
WIP
sodic Jul 17, 2025
349c303
WIP
sodic Jul 17, 2025
a8be11c
WIP
sodic Jul 17, 2025
3f338dc
WIP
sodic Jul 17, 2025
6340918
WIP
sodic Jul 17, 2025
61269f9
Testing pipeline working (module wasp build and headless tests)
sodic Jul 17, 2025
9bd3edf
Add clarifying comment
sodic Jul 17, 2025
ef66367
Attempt to use Wasp CLI from commit
sodic Jul 17, 2025
08ebadf
WIP
sodic Jul 17, 2025
dae041c
WIP
sodic Jul 17, 2025
a2d039b
WIP
sodic Jul 18, 2025
e5ac769
WIP
sodic Jul 18, 2025
c84c1a1
Get smoke test version working
sodic Jul 18, 2025
3bceb7e
Attempt some cleanup
sodic Jul 18, 2025
c542ad3
WIP
sodic Jul 18, 2025
ffcbcb6
Attempt another cleanup
sodic Jul 18, 2025
e9fdf49
WIP
sodic Jul 18, 2025
0a9a6e6
WIP
sodic Jul 18, 2025
a6c6fc9
WIP
sodic Jul 18, 2025
b69921d
Try to include railway
sodic Jul 18, 2025
ab17181
WIP
sodic Jul 18, 2025
99110ca
WIP
sodic Jul 18, 2025
64cda1c
Prevent workflow from deleting apps
sodic Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/call-test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# TODO: Remove this before merge
name: Test deploy workflow

on:
push:
branches:
- filip-automatic-deploy-test

jobs:
call-reusable:
uses: ./.github/workflows/test-deploy.yaml
secrets:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
166 changes: 166 additions & 0 deletions .github/workflows/test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Test Wasp Deploy

on:
workflow_call:
secrets:
FLY_API_TOKEN:
description: "Fly API token for deploying apps"
required: true
RAILWAY_API_TOKEN:
description: "Railway API token for deploying apps"
required: true

jobs:
deploy_kitchen_sink_app_with_fly:
name: Deploy Wasp kitchen Sink App
if: false

runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_REGION: mia

outputs:
server_hostname: ${{ steps.save_hostnames.outputs.server_hostname }}
client_hostname: ${{ steps.save_hostnames.outputs.client_hostname }}
app_prefix: ${{ steps.generate_app_prefix.outputs.app_prefix }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Workaround for a Github Checkout action bug
# https://github.com/actions/checkout/issues/1359#issuecomment-1567902034
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Haskell
uses: ./.github/actions/setup-haskell

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install Wasp CLI
working-directory: waspc
run: ./run install

- name: Install Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@v1

- name: Generate unique app prefix from commit SHA
id: generate_app_prefix
run: |
echo "app_prefix=$(echo $GITHUB_SHA | head -c 7)" >> "$GITHUB_OUTPUT"

- name: Prepare server secrets for deployment
id: prepare_secrets
working-directory: waspc/examples/todoApp
run: |
# TODO: Explain the assumptinos and the fragility of this
echo "ENV_VARS=$(
cat .env.server.headless \
| sed -E 's/#.*//' \
| awk 'NF {$1=$1;print}' \
| sed -E 's/^/--server-secret /' \
| paste -sd' ')" >> $GITHUB_ENV

- name: Deploy kitchen sink app to Fly.io
working-directory: waspc/examples/todoApp
run: |
# NOTE: Github knows not to output the db connection string, how?
# NOTE:The `yes` command is necessary because the `fly launch` command prompts for confirmation
yes | wasp-cli deploy fly launch ${{ steps.generate_app_prefix.outputs.app_prefix }} $FLY_REGION --org wasp ${{ env.ENV_VARS }}

- name: Save deployed app hostnames
id: save_hostnames
working-directory: waspc/examples/todoApp
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"

deploy_kitchen_sink_app_with_railway:
runs-on: ubuntu-latest
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Workaround for a Github Checkout action bug
# https://github.com/actions/checkout/issues/1359#issuecomment-1567902034
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Haskell
uses: ./.github/actions/setup-haskell

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install Wasp CLI
working-directory: waspc
run: ./run install

- name: Install Railway CLI
run: npm install -g @railway/cli

- name: Generate unique app prefix from commit SHA
id: generate_app_prefix
run: |
echo "app_prefix=$(echo $GITHUB_SHA | head -c 7)" >> "$GITHUB_OUTPUT"

- name: Prepare server secrets for deployment
id: prepare_secrets
working-directory: waspc/examples/todoApp
run: |
# TODO: Explain the assumptinos and the fragility of this
echo "ENV_VARS=$(
cat .env.server.headless \
| sed -E 's/#.*//' \
| awk 'NF {$1=$1;print}' \
| sed -E 's/^/--server-secret /' \
| paste -sd' ')" >> $GITHUB_ENV

- name: Deploy kitchen sink app to railway
working-directory: waspc/examples/todoApp
run: |
# NOTE: Github knows not to output the db connection string, how?
# NOTE:The `yes` command is necessary because the `fly launch` command prompts for confirmation
yes | wasp-cli deploy railway launch ${{ steps.generate_app_prefix.outputs.app_prefix }} ${{ env.ENV_VARS }}

smoke_test_kitchen_sink_app:
name: Run smoke tests on Wasp kitchen sink app

runs-on: ubuntu-latest
needs: deploy_kitchen_sink_app_with_fly
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
SERVER_HOSTNAME: ${{ needs.deploy_kitchen_sink_app.outputs.server_hostname }}
CLIENT_HOSTNAME: ${{ needs.deploy_kitchen_sink_app.outputs.client_hostname }}

steps:
- name: Smoke test the server
run: |
curl --fail --silent -X POST https://$SERVER_HOSTNAME/operations/get-date

- name: Smoke test the client
run: |
curl --fail --silent https://$CLIENT_HOSTNAME

clean_up_deployed_app:
runs-on: ubuntu-latest
name: Clean up Deployed App
needs: [deploy_kitchen_sink_app_with_fly, smoke_test_kitchen_sink_app]
if: false

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
APP_PREFIX: ${{ needs.deploy_kitchen_sink_app.outputs.app_prefix }}

steps:
- name: Install Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@v1

- name: Clean up testing app from Fly.io
run: |
# FIXME: This destroyed all our apps, be careful
# flyctl apps list -q | grep "ci-$APP_PREFIX" | xargs flyctl apps destroy -y
Loading