-
Notifications
You must be signed in to change notification settings - Fork 107
53 lines (49 loc) · 1.57 KB
/
aws-prd.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
# This workflow deploys application to the AWS PRD environment.
# Runs on each pull request to "master" branch.
name: Deploy PRD
on:
pull_request:
types: [closed]
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: node --version
- run: npm --version
- run: npm ci --no-optional
- run: npm run build
- run: npm run lint
- run: npm test
env:
CI: true
- 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: eu-central-1
- name: Copy files to the test website with the AWS CLI
run: |
aws s3 sync ./build/ s3://mri-viewer-prd --delete
- name: Invalidate cache with the AWS CLI
run: |
aws cloudfront create-invalidation --distribution-id E3O0OMPB0HHSIG --paths "/*"