Skip to content

Commit b99981e

Browse files
先にタイムアウトの設定をしよう
1 parent 1f67f7c commit b99981e

1 file changed

Lines changed: 2 additions & 46 deletions

File tree

.github/workflows/deploy_lambda.yml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,51 +32,6 @@ jobs:
3232
- name: Build
3333
run: pip install -r requirements.txt
3434

35-
- name: Load environment variables from .env file
36-
id: load-env
37-
run: |
38-
if [ -f .env ]; then
39-
echo "Loading environment variables from .env file"
40-
echo "=== .env file contents ==="
41-
cat .env
42-
echo "=========================="
43-
44-
# .envファイルから環境変数を読み取りJSON形式に変換
45-
env_json="{"
46-
first=true
47-
line_number=0
48-
while IFS='=' read -r key value || [ -n "$key" ]; do
49-
line_number=$((line_number + 1))
50-
echo "Processing line $line_number: key='$key', value='$value'"
51-
52-
# コメント行と空行をスキップ
53-
if [[ "$key" =~ ^#.*$ ]] || [[ -z "$key" ]]; then
54-
echo " -> Skipping (comment or empty)"
55-
continue
56-
fi
57-
58-
# 値からクォートを除去
59-
value=$(echo "$value" | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
60-
echo " -> Adding: $key = $value"
61-
62-
# JSONにキー・値のペアを追加
63-
if [ "$first" = true ]; then
64-
env_json="$env_json\"$key\":\"$value\""
65-
first=false
66-
else
67-
env_json="$env_json,\"$key\":\"$value\""
68-
fi
69-
done < .env
70-
env_json="$env_json}"
71-
echo "Final JSON: $env_json"
72-
echo "env-vars=$env_json" >> $GITHUB_OUTPUT
73-
else
74-
echo "No .env file found, using default environment variables"
75-
default_env='{"ENVIRONMENT":"production","LOG_LEVEL":"info","PYTHON_VERSION":"'"${{ env.PYTHON_VERSION }}"'"}'
76-
echo "Default environment variables: $default_env"
77-
echo "env-vars=$default_env" >> $GITHUB_OUTPUT
78-
fi
79-
8035
- name: Configure AWS credentials
8136
uses: aws-actions/configure-aws-credentials@v4
8237
with:
@@ -91,5 +46,6 @@ jobs:
9146
code-artifacts-dir: ./hello_lambda
9247
handler: app.lambda_handler
9348
runtime: python${{ env.PYTHON_VERSION }}
49+
role: ${{ env.lambda-role-arn }}
9450
dry-run: false
95-
environment: ${{ steps.load-env.outputs.env-vars }}
51+
timeout: 30

0 commit comments

Comments
 (0)