-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 1.77 KB
/
test-build-s3.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: S3 Test Build
on:
pull_request:
branches:
- master
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: unit tests
working-directory: backend
run: |
docker-compose build
docker-compose run --rm test
docker-compose down
build-deploy-s3:
name: Build / Deploy to S3 Test Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set-up Node
uses: actions/setup-node@v1
with:
node-version: 18
- name: AWS Creds
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: us-west-2
- name: npm install
run: |
npm install
- name: npm build frontend
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run build-stage
- name: deploy frontend to s3
run: |
aws s3 sync ./dist s3://energy-dashboard
deploy-sam:
name: Validate Serverless API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v2
- uses: aws-actions/setup-sam@v2
with:
version: 1.59.0
- 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: us-west-2
- name: Validate
working-directory: backend
run: |
sam validate