-
-
Notifications
You must be signed in to change notification settings - Fork 12
36 lines (32 loc) · 1.18 KB
/
lambda.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
name: Lambda
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get GitHub Commit SHA based on Ref
id: commit
run: |
if [[ '${{ github.ref }}' == 'refs/heads/master' ]]; then
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
fi
# Checkout the pull request branch
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: make build
- name: Deploy
run: aws s3 cp --acl public-read artifacts/lambda.zip s3://artifacts.prod.cloudposse.org/${{ github.event.repository.name }}/${{ steps.commit.outputs.sha }}/lambda.zip
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
- name: Test Download from CDN
run: curl -fsSL -o /dev/null https://artifacts.cloudposse.com/${{ github.event.repository.name }}/${{ steps.commit.outputs.sha }}/lambda.zip