-
-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (74 loc) · 3.21 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
71
72
73
74
75
76
77
name: Verify & Build
on:
push:
branches: [ main, alpha, beta ]
env:
LEFTHOOK: 0
jobs:
verify:
uses: meza/shared-github-workflows/.github/workflows/default-node-npm-ci.yml@main
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
command: "install --no-audit --no-fund"
node-version: "latest"
junit-report-path: "reports/junit.xml"
cobertura-report-path: "reports/**/cobertura-coverage.xml"
build:
environment: ${{ github.ref_name == 'main' && 'Production' || 'Staging' }}
runs-on: 'ubuntu-latest'
needs: [ verify ]
if: needs.verify.outputs.new-release-published == 'true'
steps:
- name: ⏬ Checkout
uses: actions/checkout@v3
- name: 🔧 Set up node
uses: meza/action-setup-node-npm@main
with:
command: "install --no-audit --no-fund"
node-version: latest
cache-name: ${{ needs.verify.outputs.cache-name }}
- name: 🔂 CDK Cache
uses: pat-s/[email protected]
if: always()
env:
cache-name: cdk-${{ github.ref_name }}
with:
path: ./cdk.out
key: cdk-${{ github.ref_name }}-${{ hashFiles('cdk.out/manifest.json') }}
- name: 🔢 Set version
run: npm version --no-git-tag-version ${{ needs.verify.outputs.new-release-version }}
- name: 🔨 Build
run: npm run build -- --sourcemap
env:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
NODE_ENV: ${{ env.ARC_ENV }}
GOOGLE_ANALYTICS_ID: ${{ vars.GOOGLE_ANALYTICS_ID }}
SPLIT_SERVER_TOKEN: ${{ secrets.SPLIT_SERVER_TOKEN }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
HOTJAR_ID: ${{ vars.HOTJAR_ID }}
POSTHOG_TOKEN: ${{ vars.POSTHOG_TOKEN }}
POSTHOG_API: ${{ vars.POSTHOG_API }}
COOKIEYES_TOKEN: ${{ vars.COOKIEYES_TOKEN }}
I18N_DEBUG: ${{ env.ARC_ENV == 'production' && 'false' || 'true' }}
SPLIT_DEBUG: ${{ env.ARC_ENV == 'production' && 'false' || 'true' }}
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
- name: Sentry Sourcemaps
run: npx sentry-upload-sourcemaps --release ${{ needs.verify.outputs.new-release-version }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Remove Sourcemaps from the deployment
run: rm -rf ./public/**/*.map ./build/**/*.map
- name: 📦 Deploy ${{ github.ref_name }}
run: npx cdk deploy remix-trance-stack-production -O deployment.result.json --require-approval never --context environmentName=${{ github.ref_name }} --context domainName=${{ vars.AWS_DOMAIN_NAME }} --context certificateArn=${{ secrets.AWS_CERT_ARN }} --context hostedZoneName=${{ vars.AWS_HOSTED_ZONE_NAME }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: 🚀 Github Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm run release