Serverless Not Found
Just started playing around with this. I have a few plugins in the config file, so need to do that.
Config file:
name: Deploy main branch
on:
push:
branches:
- main
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: serverless deploy
uses: serverless/[email protected]
with:
args: -c "cd backend/endpoints && \
serverless plugin install -n serverless-deployment-bucket && \
serverless plugin install -n serverless-python-requirements && \
serverless plugin install -n serverless-iam-roles-per-function && \
serverless plugin install -n serverless-offline && \
serverless deploy"
entrypoint: /bin/sh
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
But get the following error:
/bin/sh: 1: serverless: not found
Not sure what exactly needs to be in the package.json file? I added serverless as a dep but still the same error.
Any updates on this? Been stuck with this for a while @dschep?
Tried the appraoch here as well, but still doesn't solve it.
I'm not the maintainer, I believe @DavideViolante is currently maintaining this project.
I'm also quitting as a maintainer of this project. This repo needs someone from serverless company to maintain it.
Agreed. Or just archive it.
I faced the same issue. I was able to overcome this simply adding a step to install serverless before deployment starts.
workflow file:
name: CI (Push)
on:
push:
branches: [main, cs_cancellation]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup the node js environment on runner instance
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: "18.x"
# Install required project dependencies on runner for smooth deployment
- name: Install dependencies
id: install-dependencies
uses: ./.github/install-dependencies
# Configure the aws-cli on runner instance
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# Build and deploy the lambda functions packages
- name: Build and deploy lambda
id: build-and-deploy-lambda
uses: ./.github/deploy-packages
with:
lambda-function: ${{ matrix.lambda-function }}
environment-name: stage
Dependency install file
name: Install Dependencies
description: Install required project dependencies
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install serverless
run: pnpm install -g serverless
shell: bash
- name: Install dependencies
run: pnpm install
shell: bash
@ac360, tagging you so someone at serverless is aware this gh action exists without maintainers(afaik)