Addresses pre-Kubecon feedback from Marketing (#316) #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v1 | |
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@v1 | |
- 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 |