-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (127 loc) · 5.38 KB
/
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
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
name: 🌠 Deploy to production
on: workflow_dispatch
jobs:
test-client:
name: 🧪 Test client code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: client
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
working-directory: client
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
run: yarn build
working-directory: client
- name: test
run: yarn test
working-directory: client
deploy-server:
name: 🚀 Deploy server
needs: test-client
environment:
name: production
url: https://applicants-api.nycplanningdigital.com
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: server
- name: 'Install Heroku CLI'
run: curl https://cli-assets.heroku.com/install.sh | sh
- uses: akhileshns/[email protected]
name: Deploy server to Heroku
with:
heroku_email: ${{secrets.HEROKU_EMAIL}}
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{ vars.HEROKU_APP_NAME }}
team: ${{secrets.HEROKU_TEAM}}
appdir: server
env:
HD_FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HD_FEATURE_FLAG_CREEPER: ${{ vars.FEATURE_FLAG_CREEPER }}
HD_ADO_PRINCIPAL: ${{ secrets.ADO_PRINCIPAL }}
HD_AUTHORITY_HOST_URL: ${{ secrets.AUTHORITY_HOST_URL }}
HD_CITYPAY_AGENCYID: ${{ secrets.CITYPAY_AGENCYID }}
HD_CITYPAY_CUSTOMER_LINK: ${{ secrets.CITYPAY_CUSTOMER_LINK }}
HD_CITYPAY_DOMAIN: ${{ secrets.CITYPAY_DOMAIN }}
HD_CITYPAY_PASSWORD: ${{ secrets.CITYPAY_PASSWORD }}
HD_CITYPAY_POSTBACK: ${{ secrets.CITYPAY_POSTBACK }}
HD_CITYPAY_RETURN_FROM_CART: ${{ secrets.CITYPAY_RETURN_FROM_CART }}
HD_CITYPAY_RETURN_FROM_CHECKOUT: ${{ secrets.CITYPAY_RETURN_FROM_CHECKOUT }}
HD_CITYPAY_USERNAME: ${{ secrets.CITYPAY_USERNAME }}
HD_CLIENT_ID: ${{ secrets.CLIENT_ID }}
HD_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
HD_CRM_HOST: ${{ secrets.CRM_HOST }}
HD_CRM_SERVICE_CONTACT_ID: ${{ secrets.CRM_SERVICE_CONTACT_ID }}
HD_CRM_URL_PATH: ${{ secrets.CRM_URL_PATH }}
HD_FIXIE_URL: ${{ secrets.FIXIE_URL }}
HD_MS_APPLICANT_PORTAL_PASSWORD: ${{ secrets.MS_APPLICANT_PORTAL_PASSWORD }}
HD_MS_APPLICANT_PORTAL_USERNAME: ${{ secrets.MS_APPLICANT_PORTAL_USERNAME }}
HD_NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
HD_NEW_RELIC_LOG: ${{ secrets.NEW_RELIC_LOG }}
HD_NODE_ENV: ${{ vars.NODE_ENV }}
HD_NYCID_DOMAIN: ${{ secrets.NYCID_DOMAIN }}
HD_NYCID_SERVICE_ACCOUNT_USERNAME: ${{ secrets.NYCID_SERVICE_ACCOUNT_USERNAME }}
HD_NYCID_TOKEN_SECRET: ${{ secrets.NYCID_TOKEN_SECRET }}
HD_PAPERTRAIL_API_TOKEN: ${{ secrets.PAPERTRAIL_API_TOKEN }}
HD_PAYMENT_BASE_URL: ${{ secrets.PAYMENT_BASE_URL }}
HD_PAYMENT_IP_RANGE: ${{ secrets.PAYMENT_IP_RANGE }}
HD_PAYMENT_STEP1_URL: ${{ secrets.PAYMENT_STEP1_URL }}
HD_RER_FILETYPE_UUID: ${{ secrets.RER_FILETYPE_UUID }}
HD_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
HD_SHAREPOINT_CLIENT_ID: ${{ secrets.SHAREPOINT_CLIENT_ID }}
HD_SHAREPOINT_CLIENT_SECRET: ${{ secrets.SHAREPOINT_CLIENT_SECRET }}
HD_SHAREPOINT_CRM_SITE: ${{ secrets.SHAREPOINT_CRM_SITE }}
HD_SHAREPOINT_SITE_ID: ${{ secrets.SHAREPOINT_SITE_ID }}
HD_SHAREPOINT_TARGET_HOST: ${{ secrets.SHAREPOINT_TARGET_HOST }}
HD_TENANT_ID: ${{ secrets.TENANT_ID }}
HD_TOKEN_PATH: ${{ secrets.TOKEN_PATH }}
HD_ZAP_TOKEN_SECRET: ${{ secrets.ZAP_TOKEN_SECRET }}
deploy-client:
name: 🛫 Deploy client
needs: [test-client, deploy-server]
environment:
name: production
url: https://applicants.planninglabs.nyc
runs-on: ubuntu-latest
env:
FEATURE_FLAG_SELF_SERVICE: ${{ vars.FEATURE_FLAG_SELF_SERVICE }}
HOST: ${{ vars.ZAP_API_HOST }}
MAINTENANCE_START: ${{ vars.MAINTENANCE_START }}
MAINTENANCE_END: ${{ vars.MAINTENANCE_END }}
HD_NYCID_DOMAIN: ${{ secrets.NYCID_DOMAIN }}
NYCID_CLIENT_ID: ${{ vars.NYCID_CLIENT_ID }}
NYCID_DOMAIN: ${{ vars.NYCID_DOMAIN }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: client
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 12.x
- name: Install application dependencies
working-directory: client
run: yarn install --immutable --immutable-cache --check-cache
- name: Build client
working-directory: client
run: yarn run build --environment=production
- name: Install netlify
# Use npm over yarn because yarn was not respecting the exact version of a dependency
run: npm i -g [email protected]
- name: Deploy client to Netlify
run: |
netlify deploy \
--dir client/dist \
--site ${{secrets.NETLIFY_SITE_ID}} \
--auth ${{secrets.NETLIFY_AUTH_TOKEN}} \
--message "${{ github.event.head_commit.message }}"
--prod