Skip to content

Serverless Not Found #83

@amirhmk

Description

@amirhmk

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/github-action@v3.2
      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.

Activity

amirhmk

amirhmk commented on Jun 28, 2023

@amirhmk
Author

Any updates on this? Been stuck with this for a while @dschep?

Tried the appraoch here as well, but still doesn't solve it.

dschep

dschep commented on Jul 6, 2023

@dschep
Contributor

I'm not the maintainer, I believe @DavideViolante is currently maintaining this project.

DavideViolante

DavideViolante commented on Jul 6, 2023

@DavideViolante
Contributor

I'm also quitting as a maintainer of this project. This repo needs someone from serverless company to maintain it.

dschep

dschep commented on Jul 6, 2023

@dschep
Contributor

Agreed. Or just archive it.

levi-20

levi-20 commented on Mar 29, 2024

@levi-20

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
dschep

dschep commented on Apr 8, 2024

@dschep
Contributor

@ac360, tagging you so someone at serverless is aware this gh action exists without maintainers(afaik)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Serverless Not Found · Issue #83 · serverless/github-action