Skip to content

Commit 6e5bf6e

Browse files
init commit
0 parents  commit 6e5bf6e

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
defaults:
13+
run:
14+
working-directory: "./hello_world"
15+
env:
16+
PYTHON_VERSION: 3.13
17+
function-name: sample-actions-deploy-function
18+
lambda-role-arn: ${{ secrets.LAMBDA_ROLE_ARN }}
19+
jobs:
20+
main:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "${{ env.PYTHON_VERSION }}"
29+
- name: Build
30+
run: pip install -r requirements.txt
31+
32+
- name: Configure AWS credentials
33+
uses: aws-actions/configure-aws-credentials@v4
34+
with:
35+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
36+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37+
aws-region: ap-northeast-1
38+
39+
- name: Deploy Lambda
40+
uses: aws-actions/aws-lambda-deploy@v1.0.1
41+
with:
42+
function-name: ${{ env.function-name }}
43+
# working-directoryからの相対ではなくリポジトリ直下基準で判定していたので明示的に指定
44+
code-artifacts-dir: ./hello_world
45+
handler: app.lambda_handler
46+
runtime: python${{ env.PYTHON_VERSION }}
47+
role: ${{ env.lambda-role-arn }}
48+
dry-run: false
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
defaults:
13+
run:
14+
working-directory: "./hello_world"
15+
env:
16+
PYTHON_VERSION: 3.13
17+
function-name: sample-actions-deploy-function
18+
lambda-role-arn: ${{ secrets.LAMBDA_ROLE_ARN }}
19+
jobs:
20+
main:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "${{ env.PYTHON_VERSION }}"
29+
- name: Build
30+
run: pip install -r requirements.txt
31+
32+
- name: Configure AWS credentials
33+
uses: aws-actions/configure-aws-credentials@v4
34+
with:
35+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
36+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37+
aws-region: ap-northeast-1
38+
39+
- name: Deploy Lambda
40+
uses: aws-actions/aws-lambda-deploy@v1.0.1
41+
with:
42+
function-name: ${{ env.function-name }}
43+
# working-directoryからの相対ではなくリポジトリ直下基準で判定していたので明示的に指定
44+
code-artifacts-dir: ./hello_world
45+
handler: app.lambda_handler
46+
runtime: python${{ env.PYTHON_VERSION }}
47+
role: ${{ env.lambda-role-arn }}
48+
dry-run: false

0 commit comments

Comments
 (0)