Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/serverless-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: pull_request
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
permissions:
id-token: write
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/serverless-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
permissions:
id-token: write
contents: read
Expand Down
7 changes: 4 additions & 3 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ custom:
scripts:
hooks:
# sls deploy / sls package 時に bootstrap を静的ビルドする。
# macOS / Apple Silicon でも Lambda(provided.al2023, x86_64) 互換の
# 静的バイナリを得るため、linux/amd64 を明示して Docker でビルドする。
# macOS / Apple Silicon でも Lambda(provided.al2023, arm64) 互換の
# 静的バイナリを得るため、linux/arm64 を明示して Docker でビルドする。
# chmod はコンテナ内(root)で実行する。Linux ランナーでは生成物が
# root 所有になり、コンテナ外の runner ユーザーでは chmod できないため。
'before:package:createDeploymentArtifacts': |
docker run --rm --platform linux/amd64 -v "$PWD":/work -w /work crystallang/crystal:latest \
docker run --rm --platform linux/arm64 -v "$PWD":/work -w /work crystallang/crystal:latest \
sh -c "crystal build --link-flags -static -o bootstrap src/main.cr && chmod +x bootstrap"

provider:
name: aws
runtime: provided.al2023
architecture: arm64
timeout: 300
region: ap-northeast-1
stage: ${opt:stage, self:custom.defaultStage}
Expand Down
Loading