diff --git a/.github/workflows/sam.yml b/.github/workflows/sam.yml new file mode 100644 index 0000000..b0c8a58 --- /dev/null +++ b/.github/workflows/sam.yml @@ -0,0 +1,29 @@ +name: AWS SAM Deploy + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + release: + types: [ published ] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build with SAM + uses: tkt-actions/aws-sam-cli@v1 + with: + cmd: sam build + - name: Publish with SAM + if: github.event_name == 'release' + uses: tkt-actions/aws-sam-cli@v1 + with: + cmd: | + sam deploy --parameter-overrides "Version=$(git describe --tags)" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-1 diff --git a/samconfig.toml b/samconfig.toml new file mode 100644 index 0000000..6138d9e --- /dev/null +++ b/samconfig.toml @@ -0,0 +1,9 @@ +version = 0.1 + +[default.deploy.parameters] +stack_name = "zae-lambda-java-gate" +s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-ain69asg8go5" +s3_prefix = "zae-lambda-java-gate" +region = "us-east-1" +capabilities = "CAPABILITY_IAM" +confirm_changeset = false \ No newline at end of file diff --git a/template.yaml b/template.yaml new file mode 100644 index 0000000..6a3dc86 --- /dev/null +++ b/template.yaml @@ -0,0 +1,30 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: co.zeroae.gate + +Parameters: + Version: + Type: String + Description: The Layer version (SNAPSHOT, 1.0.0, etc...) + +Resources: + ZAEGateLambdaLayer: + Type: AWS::Serverless::LayerVersion + Metadata: + BuildMethod: java8.al2 + Properties: + LayerName: zae-lambda-java-gate + Description: !Sub + - ZeroAE's GATE Lambda Layer ${version} + - version: !Ref Version + ContentUri: . + CompatibleRuntimes: + - java11 + - java8.al2 + LicenseInfo: 'AGPL-3.0' + RetentionPolicy: Retain + +Outputs: + ZAEGateLambdaLayer: + Description: "ZeroAE's GATE Lambda ARN" + Value: !Ref ZAEGateLambdaLayer \ No newline at end of file