serverless/github-action

Cannot deploy: you are not currently logged in

arpecop opened this issue ยท 6 comments

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

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/

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.

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?

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

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

Created #90 to add specific options for this.