-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (28 loc) · 1011 Bytes
/
staging.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
name: Deploy router updates to staging
on:
push:
branches:
- staging
jobs:
build:
name: Run lambda and invalidate cloudfront
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- uses: actions/checkout@master
- name: test
run: |
npm install
npm test
- name: run deploy shell script
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: |
./deploy.sh ${{ secrets.STAGING_LAMBDA_NAME }} ${{ secrets.STAGING_LAMBDA_ROLE }} ${{ secrets.PROD_S3_BUCKET }} ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"