serverless / github-action

:zap::octocat: A Github Action for deploying with the Serverless Framework
Apache License 2.0
658 stars 172 forks source link

Cannot deploy: you are not currently logged in #33

Open arpecop opened 4 years ago

arpecop commented 4 years ago
name: Deploy
on:
    push:
        branches:
            - master
jobs:
    deploy:
        name: Deployment
        runs-on: ubuntu-latest
        strategy:
            matrix:
                stages:
                    - stage: 'prod'
                      AWS_SECRET_ACCESS_KEY: 'AWS_SECRET_ACCESS_KEY_PROD'
                      AWS_ACCESS_KEY_ID: 'AWS_ACCESS_KEY_ID_PROD'
        steps:
            - name: Checkout
              uses: actions/checkout@v2
            - name: npm install and build
              run: npm install
            - name: Install VPC Plugin and Deploy
              uses: serverless/github-action@v1.53.0
              with:
                  args: -c "serverless deploy --stage=${{ matrix.stages.stage }} --verbose"
                  entrypoint: /bin/bash
              env:
                  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
                  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Screenshot 2020-06-26 at 17 21 19

I added GitHub to serverless and my repos are listing there

nclaveeoh commented 4 years ago

I ran into the same problem using the AWS key approach, go with SERVERLESS_ACCESS_KEY instead. Go here to see how to create a serverless access key: https://www.serverless.com/framework/docs/dashboard/cicd/running-in-your-own-cicd/

marcelloromani commented 2 years ago

Also check whether you have

#app: your-app-name
#org: your-org-name

defined in serverless.yaml

I had, but they were wrong: removing those keys altogether fixed the "you are not logged in" issue for me.

AlexRypun commented 2 years ago

I had the same issue while deploying with bitbucket pipelines (worked fine from the local machine). The removal of "org: *****" from serverless.yml solved the problem.

Any ideas where the root of the problem is?

magiskboy commented 7 months ago

I had the same issue while deploying with bitbucket pipelines (worked fine from the local machine). The removal of "org: *****" from serverless.yml solved the problem.

Any ideas where the root of the problem is?

it worked for me

ryanlawson commented 4 months ago

If you want to use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY you need to add --use-local-credentials in your args.

ryanlawson commented 4 months ago

Created #90 to add specific options for this.