diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54c07b7..9c30b68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: 'go.mod' - - run: go build + - run: make build + - run: make zip - run: sls deploy diff --git a/.gitignore b/.gitignore index e3c8453..bd22c0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store -jiphy .serverless +bootstrap +bootstrap.zip diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..06fcfa2 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +build: + env GOOS=linux GOARCH=arm64 go build -tags lambda.norpc -o bootstrap + +zip: + zip -j bootstrap.zip bootstrap diff --git a/serverless.yml b/serverless.yml index de3c1ac..b8eaed8 100644 --- a/serverless.yml +++ b/serverless.yml @@ -2,7 +2,8 @@ service: jiphy provider: name: aws - runtime: go1.x + runtime: provided.al2 + architecture: arm64 region: eu-west-1 iam: role: @@ -26,7 +27,7 @@ provider: functions: jiphy: - handler: jiphy + handler: bootstrap url: true environment: DYNAMO_TABLE_NAME: ${env:DYNAMO_TABLE_NAME}