Continuous Deployment with fly.io
I'm looking for instruction of what is the best practice setting up CD with WASP, github actions and fly.io. Could someone please point me out to documentation?
8 Replies
Hi @lucky72o. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I can help you with setting up Continuous Deployment for your Wasp app with GitHub Actions and Fly.io.
Based on the knowledge sources, here's what's available:
GitHub Actions for Wasp Deployment
Wasp has a GitHub Action for deployment that you can use. According to the GitHub issue discussion, there is a deploy action available at:
<https://github.com/wasp-lang/deploy-action>
This action should help you set up CD with GitHub Actions.
Fly.io Deployment Commands
For deploying to Fly.io, Wasp provides CLI commands that you'll likely use in your CI/CD pipeline:
1. Initial setup (run once):
This creates your apps on Fly.io and generates
fly-server.toml and fly-client.toml files that you should commit to version control.
2. Redeployment (for CD):
This is the command you'll use in your GitHub Actions workflow to update your deployed app with the latest changes.
According to the deployment CLI documentation, you should run wasp deploy fly deploy whenever you want to update your deployed app.
Setting Up CD
While the knowledge sources don't provide a complete step-by-step guide for setting up CD with GitHub Actions, the general approach would be:
1. Use the Wasp deploy action from the repository mentioned above
2. Configure it to run wasp deploy fly deploy on pushes to your main branch
3. Ensure your fly-server.toml and fly-client.toml files are in version control
I recommend checking out the wasp-lang/deploy-action repository for specific instructions on how to configure the GitHub Action for your workflow.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @lucky72o, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Did the bot's answer help out? We talk about this in the docs: https://wasp.sh/docs/deployment/ci-cd
CI/CD Scenarios | Wasp
Setting up a CI/CD pipeline is an optional but highly recommended part of deploying applications.
yes, bot's answer was helpful, thanks!
I’ve been trying to use the wasp-lang/deploy-action GitHub Action, but it fails on ubuntu-latest because the Node version in the GitHub runner (Node 20.x) doesn’t meet Wasp’s minimum requirement (Node 22.12+). The action doesn’t automatically install the correct Node version, so it errors out before deployment.
Do you have a recommended workaround or update planned for the action so it installs the required Node version automatically?
Thanks!
I actually have on my list this sprint to deprecate the action https://github.com/wasp-lang/wasp/issues/3385 and replace it docs on how to do the deploy without the action.
What we'll recommend going forward: to just replicate the steps from the action in your own workflow:
- install Node.js
- install Wasp
- run
wasp deploy fly
You can do something like this:
GitHub
Deprecate the Wasp Github Action · Issue #3385 · wasp-lang/wasp
Deprecate the https://github.com/wasp-lang/deploy-action Reasons for the deprecation It's quite a basic action that doesn't bring that values beyond being "Wasp branded". The main...
I see, this what I ended up doing at the end
thanks!
@miho one suggestion to your deployment script is to pin the wasp installation version. My deployment jast broke because of new 0.19.0 wasp version
That's a good point - we do it usually, the script I sent over here was just a quick example so I missed that, sorry 🙈
no problem 🙂
Wohooo @lucky72o, you just became a Waspeteer level 3!