Closed giorgosera closed 2 years ago
My bad! I was running the github action in the wrong directory. I set it using the working-directory
param and it worked.
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 working-directory
value?
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 working-directory
command supported by the GitHub Actions.
Example taken from here (search for working-directory in the page):
- name: Clean temp directory
run: rm -rf *
working-directory: ./temp
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 serverless@github-action
by writing my own
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.