-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (51 loc) · 1.5 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Release
on:
release:
types: [published]
env:
UPLOAD_LAMBDA: false
jobs:
test:
name: Test lambda function
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Test
run: yarn test
build-and-upload:
name: Build GitHub action and AWS lambda function
needs: test
if: "false" # To be removed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Build lambda distribution
run: yarn dist
- 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: ${{ secrets.AWS_REGION }}
- name: Upload new build to AWS lambda
run: |
aws lambda update-function-code --function-name "$FUNCTION_ARN" --zip-file "fileb://$(pwd)/out/lambda.zip"
env:
FUNCTION_ARN: ${{ secrets.LAMBDA_FUNCTION_ARN }}
test-new-version:
name: Test uploaded lambda
needs: build-and-upload
if: "false" # To be removed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Integration tests
run: yarn test
env:
LAMBDA_URL: ${{ secrets.LAMBDA_URL }}