-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (84 loc) · 3.18 KB
/
deploy-production.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
name: Deploy to production
"on":
push:
branches:
- master
jobs:
deploy:
environment: Production
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install expect
run: sudo apt-get -y install expect
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache node modules and firebase emulators
uses: actions/cache@v3
with:
path: |
~/.rush
~/.pnpm-store
common/temp
**/node_modules
~/.cache/firebase/emulators
key: ${{ runner.os }}-modules-emulators-node18-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Add rush directory to PATH
run: echo PATH=$PWD/common/scripts/:$PATH >> $GITHUB_ENV
- name: Install dependencies
run: rush update
- name: Build eisbuk packages
run: rush build
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Generate name for sentry release
run: echo "SENTRY_RELEASE=$(date +%Y-%m-%d)-${{ env.GITHUB_SHA_SHORT }}" >> $GITHUB_ENV
- name: Build app
run: cd packages/client && rushx build:prod
env:
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
REACT_APP_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
REACT_APP_DATABASE_URL: ${{ secrets.DATABASE_URL }}
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }}
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_IGORICE_DSN }}
REACT_APP_SENTRY_ENVIRONMENT: production
REACT_APP_SENTRY_RELEASE: ${{ env.SENTRY_RELEASE }}
- name: Create Sentry release for client app
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: eisbuk
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
sourcemaps: ./packages/client/dist/assets
version: ${{ env.SENTRY_RELEASE }}
- name: Create Sentry release for client app
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: eisbuk
SENTRY_PROJECT: functions
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
sourcemaps: ./packages/functions/dist/
version: ${{ env.SENTRY_RELEASE }}
- name: Deploy to firebase
run: |
echo FUNCTIONS_SENTRY_DSN="$FUNCTIONS_SENTRY_DSN" > packages/functions/.env
echo REACT_APP_SENTRY_RELEASE="$REACT_APP_SENTRY_RELEASE" >> packages/functions/.env
rush deploy:production
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_EISBUK }}
FUNCTIONS_SENTRY_DSN: ${{ secrets.FUNCTIONS_SENTRY_DSN }}
REACT_APP_SENTRY_RELEASE: ${{ env.SENTRY_RELEASE }}