Skip to content

Commit 7629c91

Browse files
複数Lambdaの一斉デプロイができるように
1 parent 5782444 commit 7629c91

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/deploy_lambda.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,34 @@ on:
1212
permissions:
1313
id-token: write
1414
contents: read
15-
defaults:
16-
run:
17-
working-directory: "external_library_lambda"
15+
1816
env:
1917
PYTHON_VERSION: 3.13
20-
function-name: external_library_lambda
2118
lambda-role-arn: ${{ secrets.LAMBDA_ROLE_ARN }}
19+
2220
jobs:
23-
main:
21+
deploy:
2422
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
lambda-function:
26+
- name: external_library_lambda
27+
directory: external_library_lambda
28+
- name: hello_lambda
29+
directory: hello_lambda
2530
steps:
2631
- name: Checkout code
2732
uses: actions/checkout@v4
33+
2834
- name: Setup python
2935
uses: actions/setup-python@v5
3036
with:
3137
python-version: "${{ env.PYTHON_VERSION }}"
38+
3239
- name: Install dependencies to deployment package
40+
working-directory: ${{ matrix.lambda-function.directory }}
3341
run: |
3442
pip install -r requirements.txt -t .
35-
ls -la
3643
3744
- name: Configure AWS credentials
3845
uses: aws-actions/configure-aws-credentials@v4
@@ -44,8 +51,8 @@ jobs:
4451
- name: Deploy Lambda
4552
uses: aws-actions/aws-lambda-deploy@v1.0.1
4653
with:
47-
function-name: ${{ env.function-name }}
48-
code-artifacts-dir: ./external_library_lambda
54+
function-name: ${{ matrix.lambda-function.name }}
55+
code-artifacts-dir: ./${{ matrix.lambda-function.directory }}
4956
handler: app.lambda_handler
5057
runtime: python${{ env.PYTHON_VERSION }}
5158
role: ${{ env.lambda-role-arn }}

0 commit comments

Comments
 (0)