Merge pull request #645 from AI4Bharat/SN-804 #434
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
AZURE_CREDS: ${{ secrets.SHOONYA_AZURE_CREDS }} | |
AZURE_STORAGEKEY: ${{ secrets.SHOONYA_AZURE_STORAGEKEY_DEVELOP }} | |
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 --account-name shoonyastoragedevelop --account-key ${{ env.AZURE_STORAGEKEY }} -d '$web' -s ./build --overwrite | |
- name: Purge CDN endpoint | |
uses: azure/CLI@v1 | |
with: | |
inlineScript: | | |
az cdn endpoint purge --no-wait --content-paths "/*" --profile-name develop-react-static --name frontend-develop-shoonya --resource-group shoonya | |
- name: Azure logout | |
run: | | |
az logout | |
if: always() |