diff --git a/.github/workflows/build-lambda-package.yml b/.github/workflows/build-lambda-package.yml new file mode 100644 index 0000000..d3e727c --- /dev/null +++ b/.github/workflows/build-lambda-package.yml @@ -0,0 +1,40 @@ +name: Build Lambda Package + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Run tests + run: go test ./... + + - name: Build Lambda binary + env: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + run: go build -tags lambda -o bootstrap + + - name: Package Lambda artifact + run: zip function.zip bootstrap + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: lambda-function + path: function.zip + if-no-files-found: error