-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (44 loc) · 1.38 KB
/
cd-prod-react.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
# Docs for the Azure Web Apps Deploy action: https://go.microsoft.com/fwlink/?linkid=2134798
# More GitHub Actions for Azure: https://go.microsoft.com/fwlink/?linkid=2135048
name: CD - Production - React SPA
concurrency:
group: continuous_delivery_spa
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- 'src/caretogether-pwa/**'
- '.github/workflows/cd-prod-react.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- name: Checkout source
uses: actions/checkout@v3
# Build React frontend
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: src/caretogether-pwa
- name: Install NPM packages
run: npm ci
working-directory: src/caretogether-pwa
- name: Build React app
run: npm run build
working-directory: src/caretogether-pwa
- name: List build outputs
run: ls -R dist
working-directory: src/caretogether-pwa
# Deploy React frontend
- name: Deploy React PWA to Azure
uses: azure/webapps-deploy@v2
with:
app-name: 'caretogether-pwa'
slot-name: 'production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CARETOGETHER_PWA }}
package: src/caretogether-pwa/dist