-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (48 loc) · 1.55 KB
/
atd_moped_cloudfront_cognito.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
#
# Builds the Cognito-at-edge validator from:
# https://github.com/awslabs/cognito-at-edge
#
name: "Build & Deploy CloudFront Cognito Auth"
on:
push:
branches:
- main
- production
paths:
- "moped-auth/cloudfront-cognito-at-edge/**"
- ".github/workflows/atd_moped_cloudfront_cognito.yml"
- ".github/workflows/aws-moped-cognito-edge-helper.sh"
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.8"
architecture: "x64"
# Get the code first
- name: "Checkout"
uses: actions/checkout@v3
# Then install the AWC CLI tools & boto3
- name: "Install AWS Cli"
run: |
sudo apt-get install python3-setuptools
pip3 install awscli boto3
# Run the shell commands using the AWS environment variables
- name: "Build"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
export BRANCH_NAME=${GITHUB_REF##*/}
echo "SHA: ${GITHUB_SHA}"
echo "ACTION/BRANCH_NAME: ${BRANCH_NAME}"
echo "GR: ${GITHUB_REF}"
echo "PWD: $(pwd)"
echo "PR_NUMBER: ${PR_NUMBER}"
source $(pwd)/.github/workflows/aws-moped-cognito-edge-helper.sh
build_lambda_function
deploy_lambda_function