Skip to content

Update environment_create.go #13

Update environment_create.go

Update environment_create.go #13

Workflow file for this run

name: setup-deploy
on:
push:
branches: [main]
paths:
- 'setup/**'
workflow_dispatch:
jobs:
publish_lambda_function:
name: Publish and Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./setup
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::429114214526:role/gh-action-iam-role-Role-16C5S7FD9ZO4T
aws-region: us-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ steps.login-ecr.outputs.registry }}/replicatedlabs
tags: |
# minimal (short sha)
type=sha
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
IMAGE_TAG: ${{ steps.meta.outputs.tags }}
run: |
docker build -f Dockerfile -t $IMAGE_TAG .
docker push $IMAGE_TAG
- name: Update Lambda function with latest ECR image
env:
LAMBDA_NAME: createlab
IMAGE_TAG: ${{ steps.meta.outputs.tags }}
run: |
aws lambda update-function-code \
--function-name $LAMBDA_NAME \
--image-uri $IMAGE_TAG