-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (36 loc) · 1.2 KB
/
search.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
name: search-build
on:
push:
branches:
- master
- main
paths:
- 'apps/search/**'
defaults:
run:
working-directory: 'apps/search'
jobs:
build:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
runs-on: ubuntu-latest
steps:
# Build
- uses: actions/checkout@v2
- run: yarn install
- run: yarn build
env:
WEBSITE_HOST: ${{ secrets.WEBSITE_HOST }}
# Sync build files to S3 bucket
- uses: chrislennon/action-aws-cli@v1.1
- run: aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/search/latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Create Cloudfront invalidation to update to latest
- uses: chrislennon/action-aws-cli@v1.1
- run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/search/latest/remoteEntry.js"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_CF_DISTRIBUTION_ID: ${{ secrets.AWS_CF_DISTRIBUTION_ID }}