appleboy/lambda-action

Environment variable for lambda

aleon68 opened this issue · 3 comments

how can add on publish environment variables to config lambda?

try the following example:

      - name: deploy zip
        uses: appleboy/lambda-action@master
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws_region: ${{ secrets.AWS_REGION }}
          function_name: gorush
          zip_file: example/deployment.zip
          environment: foo=bar,author=appleboy
          debug: true

I will release the new version asap.

I am deploying golang lambda function and it's work:

deploy_functions:
    name: deploy lambda function
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go-version: [ 1.20.x ]
    steps:
      - name: checkout source code
        uses: actions/checkout@v3

      - name: Install Go
        uses: actions/setup-go@v1
        with:
          go-version: ${{ matrix.go-version }}

      - name: Build Email Lambda function binary
        working-directory: notifications
        run: |
          CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -a -o main lambda/email/main.go && zip email-deployment.zip main
       
      - name: email deploy
        uses: appleboy/lambda-action@v0.1.9
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws_region: ${{ secrets.AWS_REGION }}
          function_name: email-${{ env.ENVIRONMENT }}
          handler: main
          zip_file: ./notifications/email-deployment.zip
          publish: true
          memory_size: 128
          timeout: 10
          runtime: go1.x
          environment: foo=bar,author=appleboy
       
Screenshot 2024-01-09 at 15 17 48

I have tried capitalising the environment keys and other random stuff but I can't seem to set the environment variables.
@appleboy

@IamNator Can you open another issue for reporting the bugs? Thanks.