UNPKG

@kumologica/builder

Version:

Kumologica build and deploy module

73 lines (64 loc) 2.06 kB
name: | Example github action workflow demonstrating deployment of Kumologica flow to the aws account Generated by kumologica sdk KL_VER on KL_TS on: push: branches: - main env: KL_ENV jobs: deploy: name: Deploy kumologica flow runs-on: ubuntu-latest strategy: matrix: node-version: [18.x] steps: # checkout repository - name: checkout sources uses: actions/checkout@v2 # setup aws credentials - uses: actions/checkout@v2 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} # setup right node version - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} # install kumologica cli - name: Install kumologica cli run: | npm install -g @kumologica/sdk --ignore-scripts # build kumologica flow - name: build kumologica flow lambda run: kl build aws # generate cloudformation script # note we pass environment variables so iam role will # contain valid resources - name: generate cloudformation script run: | kl export cloudformation \ KL_CM # cloud formation package - name: cf package run: | aws cloudformation package \ --template-file ./build/template.json \ --s3-bucket ${{ env.BUCKET_NAME }} \ --s3-prefix ${{ env.LAMBDA_NAME }} \ --output-template-file template.yml # cloudformation deploy - name: Deploy CloudFormation Stack uses: aws-actions/aws-cloudformation-github-deploy@v1.0.3 with: name: ${{ env.LAMBDA_NAME }} template: template.yml capabilities: CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND no-fail-on-empty-changeset: "1"