Skip to content

Commit 0534ea6

Browse files
committed
update: using chat function workflows
1 parent a8fa7ec commit 0534ea6

File tree

1 file changed

+20
-38
lines changed

1 file changed

+20
-38
lines changed

.github/workflows/dev.yml

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -57,43 +57,25 @@ jobs:
5757
path: ./reports/pytest.xml
5858
if-no-files-found: warn
5959

60-
deploy:
61-
name: Deploy to AWS Lambda
62-
runs-on: ubuntu-latest
60+
build:
61+
name: Build Docker Image
62+
uses: lambda-feedback/chat-function-workflows/.github/workflows/gh_build.yml@main
6363
needs: test
64-
steps:
65-
- name: Checkout Code
66-
uses: actions/checkout@v4
67-
68-
- name: Configure AWS Credentials
69-
uses: aws-actions/configure-aws-credentials@v4
70-
with:
71-
# Created the Secrets Under the Repo only with These Variables
72-
aws-access-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
73-
aws-secret-access-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET }}
74-
aws-region: eu-west-2
64+
permissions:
65+
contents: read
66+
id-token: write
67+
packages: write
7568

76-
- name: Login to Amazon ECR
77-
id: login-pf-aws-ecr
78-
uses: aws-actions/amazon-ecr-login@v2
79-
80-
- name: Build and push the tagged docker image to Amazon ECR
81-
id: build-custom-image
82-
env:
83-
ECR_REGISTRY: ${{ steps.login-pf-aws-ecr.outputs.registry }}
84-
ECR_REPOSITORY: lambda-feedback-dev-chat
85-
IMAGE_TAG: latest
86-
run: |
87-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
88-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
89-
90-
- name: Update aws custom lambda function code
91-
env:
92-
ECR_REGISTRY: ${{ steps.login-pf-aws-ecr.outputs.registry }}
93-
ECR_REPOSITORY: lambda-feedback-dev-chat
94-
IMAGE_TAG: latest
95-
FUNCTION_NAME: lambda-feedback-dev-chat
96-
run: |
97-
aws lambda update-function-code \
98-
--function-name $FUNCTION_NAME \
99-
--image-uri $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
69+
deploy:
70+
name: Deploy to Lambda Feedback
71+
uses: lambda-feedback/chat-function-workflows/.github/workflows/dev_deploy.yml@main
72+
needs: test
73+
with:
74+
template-repository-name: "lambda-feedback/chat-function-boilerplate"
75+
permissions:
76+
contents: read
77+
id-token: write
78+
packages: write
79+
secrets:
80+
aws-access-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
81+
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}

0 commit comments

Comments
 (0)