This repository was archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (51 loc) · 1.43 KB
/
deploy.yml
File metadata and controls
65 lines (51 loc) · 1.43 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
name: Deploy
on:
push:
branches:
- 'main'
# push:
# tags:
# - '*'
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 12.x
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: 3.x
- name: Cache Dependencies
uses: actions/cache@v2.1.6
with:
path: |
node_modules
~/.cache/pip
key: yarn-${{ hashFiles('yarn.lock') }}
- name: Install AWS CLI
run: pip install --user awscli
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: Deploy
run: yarn deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Create Invalidation
run: |
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}