-
-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (101 loc) · 3.27 KB
/
push.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
name: Push
on:
- push
jobs:
backend:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use node
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
- run: npm i
working-directory: backend
- run: npm run build
working-directory: backend
- name: Sentry Release
if: github.ref == 'refs/heads/main'
uses: getsentry/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
with:
sourcemaps: backend/build-web
environment: production
ignore_empty: true
projects: web
- uses: "google-github-actions/auth@v2"
if: github.ref == 'refs/heads/main'
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
- name: Deploy
if: github.ref == 'refs/heads/main'
run: |
echo "${API_ENV_YAML}" >> .env.yaml
gcloud functions deploy api --gen2 \
--region=europe-west1 \
--runtime=nodejs20 \
--trigger-http \
--env-vars-file .env.yaml \
--memory=1G \
--allow-unauthenticated
working-directory: backend
env:
API_ENV_YAML: ${{ secrets.API_ENV_YAML }}
browser-extension:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Use node
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
- run: npm i
working-directory: browser-extension
- run: npm run build
working-directory: browser-extension
frontend:
runs-on: ubuntu-22.04
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use node
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
- run: npm ci
working-directory: backend
- run: npm ci
working-directory: frontend
- name: Lint
run: npm run lint
working-directory: frontend
- name: Build
run: npm run build
working-directory: frontend
- name: Deploy
run: npm run deploy -- --prod
if: github.ref == 'refs/heads/main'
working-directory: frontend
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Sentry Release
if: github.ref == 'refs/heads/main'
uses: getsentry/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
with:
sourcemaps: frontend/build/static/js
environment: production
ignore_empty: true
projects: frontend