-
Notifications
You must be signed in to change notification settings - Fork 20
80 lines (60 loc) · 1.79 KB
/
production_release.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
69
70
71
72
73
74
75
76
77
78
79
80
name: Release to production
on:
push:
tags: '*'
permissions:
id-token: write
contents: read
jobs:
frontend-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Setup Node version
with:
node-version-file: frontend/.nvmrc
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: ./frontend
- name: Run linter
run: npm run lint
working-directory: ./frontend
- name: Run type checks
run: npm run ts-validate
working-directory: ./frontend
- name: Run frontend tests
run: npm test
working-directory: ./frontend
backend-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Python version
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install python dependencies
run: pip3 install -r requirements.txt
- name: Run backend tests
run: pytest
release:
runs-on: ubuntu-20.04
needs: [frontend-tests, backend-tests]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.ACTION_PRODUCTION_RELEASE_ROLE }}
- name: Build and upload Docker image
run: ./scripts/build_and_release_image.sh --tag ${{ github.ref_name }}
- name: Upload infrastructure files to S3
run: ./infrastructure/release_infrastructure.sh