Skip to content
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

Serverless Not Found #83

Open
amirhmk opened this issue May 30, 2023 · 6 comments
Open

Serverless Not Found #83

amirhmk opened this issue May 30, 2023 · 6 comments

Comments

@amirhmk
Copy link

amirhmk commented May 30, 2023

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.

@amirhmk
Copy link
Author

amirhmk commented Jun 28, 2023

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
Copy link
Contributor

dschep commented Jul 6, 2023

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

@DavideViolante
Copy link
Contributor

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

@dschep
Copy link
Contributor

dschep commented Jul 6, 2023

Agreed. Or just archive it.

@levi-20
Copy link

levi-20 commented Mar 29, 2024

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
Copy link
Contributor

dschep commented Apr 8, 2024

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants