-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (41 loc) · 1.46 KB
/
lambda_package_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Publish
on:
push:
tags:
- '*'
jobs:
build:
name: Publish Lambda package in releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
working-directory: ./account_monitor
run: bash build_lambda.sh
- name: Upload Lambda package to releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: account_monitor/lambda-account-monitor-package.zip
- name: Upload Lambda package to releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: account_monitor/lambda-account-monitor-package.zip
deploy_to_s3:
name: Upload Lambda package to s3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
working-directory: ./account_monitor
run: bash build_lambda.sh
- name: Rename and upload to s3
run: |
mv ./account_monitor/lambda-account-monitor-package.zip ./account_monitor/lambda-account-monitor-package-${{ github.ref_name }}.zip
aws s3 cp ./account_monitor/lambda-account-monitor-package-${{ github.ref_name }}.zip s3://${{ env.DEPLOYMENT_BUCKET }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
DEPLOYMENT_BUCKET: ${{ secrets.DEPLOYMENT_BUCKET }}