Github actions error with wasp in /app
Here is my github action file:
name: Deploy to Fly
on:
push:
branches:
- "master" # Or "main"
jobs:
deploy:
name: Deploy with Wasp
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
# --- Start Debugging Steps ---
- name: List files in root directory
run: ls -la
# This shows if the 'app' directory is present at the top level after checkout
- name: List files in app directory
run: ls -la ./app
# This shows the contents of the 'app' directory
# Check if main.wasp and other expected files/folders (like src) are listed here
# --- End Debugging Steps ---
- name: Deploy to Fly via Wasp
uses: wasp-lang/deploy-action@main
with:
fly-token: ${{ secrets.FLY_TOKEN }}
# node-version: "20.18.0" # Optional
working-directory: ./app # Keep this as your project is in ./app
Getting this error:
Couldn't find wasp project root - make sure you are running this command from a Wasp project.
7 Replies
Hi @Gwain. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I can see you're having an issue with your GitHub Actions workflow when trying to deploy your Wasp app to Fly.io. The error message indicates that the action can't find your Wasp project root.
The Issue
The error message "Couldn't find wasp project root - make sure you are running this command from a Wasp project." suggests that the GitHub Action is unable to locate your Wasp project files in the expected location.
Based on your debugging steps, it seems you have your Wasp project in an
./app
directory, and you've correctly specified this in your workflow using the working-directory: ./app
parameter.
Possible Solutions
1. Check for main.wasp file: Make sure your main.wasp
file exists in the ./app
directory. This is the primary file that identifies a Wasp project.
2. File structure: Ensure your Wasp project has the correct structure with the necessary files and directories (like src/
).
3. Custom Dockerfile: If you've modified the deployment process, you might need to create a custom Dockerfile as mentioned in the Discord support thread. Some users have had to modify the deployment process for specific customizations:
Discord support thread
4. Wasp version: Make sure you're using a compatible version of Wasp. The GitHub Action might be using a different version than what your project requires.
GitHub Actions Specific Considerations
It's worth noting that there's an open GitHub issue (#602) about implementing a Wasp GitHub CI Action, which suggests that GitHub Actions integration might still be evolving:
Implement a Wasp Github CI Action
Next Steps
1. Try running the deployment locally first using wasp deploy fly deploy
to ensure everything works correctly.
2. If you're still having issues, you might want to consider the manual deployment approach as described in the Wasp documentation:
Deploying Manually
3. Join the Wasp Discord community for more direct support:
Join Wasp Discord
If you need more specific help, please share the output of your debugging steps (the ls -la
commands) so I can better understand your project structure.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Gwain, 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?@miho Any advice on why it's not able to deploy when changing the working directory to ./app? 😄
You can't use
working-directory
with a uses:
step, only a run:
step. Instead, add a prior run
step to set the correct working directory:
@genyus Unfortunetly that doesn't work. However I refactored my project to have the wasp in the root.
But now another issue
It seems to error out on the npm install section. Not happening locally
Any ideas @kapa.ai ?
Wohooo @Gwain, you just became a Waspeteer level 4!
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the information you've shared and the error message you're encountering in your GitHub Actions workflow, I have a few additional suggestions to help resolve the issue:
1. Verify the Wasp project structure: Make sure your
app
directory contains a valid Wasp project with a main.wasp
file at its root. The deployment action specifically looks for this file to identify a Wasp project.
2. Check GitHub Actions permissions: Ensure that your GitHub Actions workflow has proper permissions to access your repository files. Sometimes checkout actions might not retrieve all files correctly.
3. Try specifying the Wasp version: You can add the node-version
parameter in your workflow file (which you've commented out). This might help ensure compatibility:
4. Custom Dockerfile approach: As mentioned in the Discord support thread, you might need to create a custom Dockerfile in your project root to handle specific deployment requirements.
5. Debugging the action: You could add more debugging steps to your workflow to see what's happening:
6. Try manual deployment: If the GitHub Action continues to fail, you could follow the manual deployment approach as described in the Wasp documentation.
7. Check for hidden files: Sometimes version control systems might ignore certain files. Make sure all necessary files are being properly checked out in your GitHub Actions workflow.
If you're still facing issues, it might be helpful to share the output of your debugging steps (the ls -la
commands) so I can better understand your project structure and provide more targeted assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Gwain, 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?Hey, @Gwain.
Just to make sure you followed steps on here: https://github.com/wasp-lang/deploy-action/blob/main/README.md
The app needs to be launched locally at least once.
From what I can see in: https://github.com/wasp-lang/deploy-action/blob/main/action.yml
There is no
working-directory
or node-version
input. That means there is no benefit to passing those to the action.
Instead use it on job/step level or do something like @genyus suggested.
The last error message seems like node version mismatch error to me. I know we check for node version, so that confuses me a bit. Are you sure the CLI uses node 20?