-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy fails with "This command can only be run in a Serverless service directory." #42
Comments
My bad! I was running the github action in the wrong directory. I set it using the Sorry for the unnecessary issue. |
@giorgosera Can you share the yml file you used to get this to work? What changes did you make, where did you put the |
I'm also struggling to configure the working directory |
same, would love to know which fixed it |
Hey everyone, Unfortunately, it's been a while and I cannot recall how I fixed it! I thought that my follow up message would help othersin the future but apparently it doesn't. I hope you find a workaround! I know how frustrating it can be :( |
I think he added in the yml the
If someone can try it I will add some info in the readme for clarity. I'm not currently using this action. |
I tried but failed. Ended up doing without name: GitHub Actions Deploy ID Dev
on:
push:
branches:
- main
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn workspace @berry/shared build
- run: node ./node_modules/serverless/bin/serverless.js config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile papaya --overwrite
- run: node ../../node_modules/serverless/bin/serverless.js deploy --aws-s3-accelerate --stage dev --verbose
working-directory: ./services/id
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SLS_DEBUG: 1 |
I got around this by moving the serverless project to the root of the repo. Not ideal but it got me unstuck. |
See: #53 |
I have the following workflow file at
.github/workflows/deploy-serverless.yml
. It is identical to the one in the README except for thenpm ci
line.When I run this action it fails at the step
serverless deploy
with the following error:Am I supposed to put the workflow file in my service directory? If yes how will github find it and run it? Maybe I'm missing something obvious here so I'd appreciate your help.
Thanks
PS: I can manually deploy my code with no issues.
The text was updated successfully, but these errors were encountered: