-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (108 loc) · 3.2 KB
/
master_mapleriverbasketball.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
130
131
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and Deploy to Azure
on:
push:
branches:
- release
workflow_dispatch:
env:
NODE_ENV: production
jobs:
build-base:
name: Build Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Upload
uses: actions/upload-artifact@v3
with:
name: node-app
path: package.json
build-client:
name: Build Client
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v3
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/client/package-lock.json'
- name: Install
run: npm ci
- name: Build
run: npm run build
env:
REACT_APP_AUTH0_AUDIENCE: ${{ secrets.REACT_APP_AUTH0_AUDIENCE }}
REACT_APP_AUTH0_DOMAIN: ${{ secrets.REACT_APP_AUTH0_DOMAIN }}
REACT_APP_AUTH0_CLIENT_ID: ${{ secrets.REACT_APP_AUTH0_CLIENT_ID }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: client-build
path: client/build
build-server:
name: Build Server
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- uses: actions/checkout@v3
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/server/package-lock.json'
- name: Install
run: npm ci
- name: Build
run: npm run build
env:
REACT_APP_AUTH0_AUDIENCE: ${{ secrets.REACT_APP_AUTH0_AUDIENCE }}
REACT_APP_AUTH0_DOMAIN: ${{ secrets.REACT_APP_AUTH0_DOMAIN }}
AUTH0_API_CLIENT_ID: ${{ secrets.AUTH0_API_CLIENT_ID }}
AUTH0_API_CLIENT_SECRET: ${{ secrets.AUTH0_API_CLIENT_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: server-build
path: server/build
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [build-base, build-client, build-server]
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download App Artifacts
uses: actions/download-artifact@v3
with:
name: node-app
- name: Download Client
uses: actions/download-artifact@v3
with:
name: client-build
path: client/build
- name: Download Server
uses: actions/download-artifact@v3
with:
name: server-build
path: server/build
- name: Deploy to Azure
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
images: ''
app-name: 'mapleriverbasketball'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_725A7776FF3A481CB7B0C252AFBE1432 }}
package: .