-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (64 loc) · 2.13 KB
/
deploy.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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: netlify
strategy:
matrix:
node-version: [15]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}.x
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Cache ~/.pnpm-store
uses: actions/cache@v2
env:
cache-name: cache-pnpm-store
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-build-
${{ runner.os }}-
- uses: pnpm/action-setup@8e1abe543ff1fa17b5d36e08ed01b4a1e4c31eb4
with:
version: 5.17
run_install: |
- recursive: true
args: [--frozen-lockfile]
- name: Build 🔧
env:
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
REACT_APP_DEPLOY_SHA: ${{ env.GITHUB_SHA }}
REACT_APP_CONTEXT: production
run: |
pnpm -C crosswrd-app run build
- name: Deploy to Netlify 🚀
id: netlify-deploy
run: |
pnpm add -g netlify
bash "${GITHUB_WORKSPACE}/.github/netlify.sh" deploy --prod \
--message="Branch ${GITHUB_REF##*/} (${GITHUB_SHA})" \
--dir=crosswrd-app/build
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Create a Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production