-
Notifications
You must be signed in to change notification settings - Fork 13
56 lines (45 loc) · 1.53 KB
/
build-release-develop.yaml
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
name: Build and Release React App for Develop
on:
push:
branches: [develop]
workflow_dispatch:
workflow_call:
env:
CI: false
NODE_OPTIONS: "--max_old_space_size=4096"
REACT_APP_APIGW_BASE_URL: ${{ secrets.REACT_APP_APIGW_BASE_URL_DEVELOP }}
REACT_APP_XLIT_APIKEY: ${{ secrets.REACT_APP_XLIT_APIKEY }}
AZURE_CREDS: ${{ secrets.SHOONYA_AZURE_CREDS_E2E }}
AZURE_STORAGEKEY: ${{ secrets.SHOONYA_AZURE_STORAGEKEY_DEVELOP_E2E }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.SHOONYA_AZURE_CONNECTION_STRING_DEVELOP_E2E }}
jobs:
cicd:
name: CICD_DEVELOP
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
- name: Install NPM packages
run: npm install --legacy-peer-deps
- name: Build project
run: npm run build
- name: Azure login
uses: azure/login@v1
with:
creds: ${{ env.AZURE_CREDS }}
- name: Upload to blob storage
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob upload-batch --connection-string ${{ env.AZURE_STORAGE_CONNECTION_STRING }} --destination '$web' --source ./build --overwrite
- name: Purge CDN endpoint
uses: azure/CLI@v1
with:
inlineScript: |
az cdn endpoint purge --no-wait --content-paths "/*" --profile-name shoonya-dev-cdn --name shoonya-dev-cdn-endpoint --resource-group shoonya-dev
- name: Azure logout
run: |
az logout
if: always()