-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
146 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Build Lambda images | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
for lambdaFolderPath in $(pwd)/lambda-code/*/; do | ||
lambdaName=$(basename $lambdaFolderPath) | ||
cd $lambdaFolderPath | ||
repositoryName=${lambdaName}-lambda | ||
docker build -t $repositoryName . | ||
done | ||
shell: bash |
20 changes: 20 additions & 0 deletions
20
.github/workflows/request-lambda-functions-to-use-latest-image/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Request Lambda functions to use latest image | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Login to Staging Amazon ECR | ||
id: login-ecr-staging | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Update Lambda function code | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr-staging.outputs.registry }} | ||
run: | | ||
for lambdaFolderPath in $(pwd)/lambda-code/*/; do | ||
lambdaName=$(basename $lambdaFolderPath) | ||
cd $lambdaFolderPath | ||
repositoryName=${lambdaName}-lambda | ||
aws lambda update-function-code --function-name $lambdaName --image-uri $ECR_REGISTRY/$repositoryName:latest | ||
done | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Tag and push Lambda images | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Login to Staging Amazon ECR | ||
id: login-ecr-staging | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Tag and push docker images | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr-staging.outputs.registry }} | ||
run: | | ||
for lambdaFolderPath in $(pwd)/lambda-code/*/; do | ||
lambdaName=$(basename $lambdaFolderPath) | ||
cd $lambdaFolderPath | ||
repositoryName=${lambdaName}-lambda | ||
docker tag $repositoryName $ECR_REGISTRY/$repositoryName:${GITHUB_SHA::7} | ||
docker tag $repositoryName $ECR_REGISTRY/$repositoryName:latest | ||
docker push $ECR_REGISTRY/$repositoryName:${GITHUB_SHA::7} | ||
docker push $ECR_REGISTRY/$repositoryName:latest | ||
done | ||
shell: bash | ||
|
||
- name: Logout of Staging Amazon ECR | ||
run: docker logout ${{ steps.login-ecr-staging.outputs.registry }} | ||
shell: bash |
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
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
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
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
Oops, something went wrong.