-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (110 loc) · 3.51 KB
/
nodejs.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.17.1]
env:
CI: true
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Yarn install
run: |
yarn --immutable
- name: Build front-end
run: |
yarn build-front:prod
- name: Run Prettier
run: |
yarn prettier:check
- name: Run ESLint
run: |
yarn eslint
- name: Run stylelint
run: |
yarn stylelint
- name: TS type check
run: |
yarn type-check
- name: Cache MongoDB binary
uses: actions/cache@v3
with:
path: ~/.cache/mongodb-binaries
key: ${{ runner.os }}-mongodb
- name: Run Vitest tests
run: |
yarn test
- name: Run Playwright tests
run: |
yarn docker-compose:test
- name: Upload test results if Playwright tests failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-videos
path: client/playwright/test-results/
- name: Build staging container
if: github.ref == 'refs/heads/main'
run: |
yarn docker:build-staging
- name: Push staging container to AWS ECR
if: github.ref == 'refs/heads/main'
uses: jwalton/[email protected]
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: eu-west-1
image: konsti-staging:latest
- name: Create frontend-staging Sentry release
if: github.ref == 'refs/heads/main'
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-frontend-staging
with:
sourcemaps: "./client/build"
- name: Create backend-staging Sentry release
if: github.ref == 'refs/heads/main'
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-backend-staging
- name: Build prod container
if: github.ref == 'refs/heads/main'
run: |
yarn docker:build-prod
- name: Push prod container to AWS ECR
if: github.ref == 'refs/heads/main'
uses: jwalton/[email protected]
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: eu-west-1
image: konsti-prod:latest
- name: Create frontend-prod Sentry release
if: github.ref == 'refs/heads/main'
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-frontend-prod
with:
sourcemaps: "./client/build"
- name: Create backend-prod Sentry release
if: github.ref == 'refs/heads/main'
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: konsti
SENTRY_PROJECT: konsti-backend-prod