-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,422 additions
and
225 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Prod Environment - Build and Release React App | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
env: | ||
CI: false | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
REACT_APP_APIGW_BASE_URL: ${{ vars.PROD__REACT_APP_APIGW_BASE_URL }} | ||
AZURE_STORAGE_ACCOUNT_NAME: ${{ vars.PROD__AZURE_STORAGE_ACCOUNT_NAME }} | ||
AZURE_STORAGEKEY: ${{ secrets.PROD__AZURE_STORAGEKEY }} | ||
AZURE_CDN_PROFILE: ${{ vars.PROD__AZURE_CDN_PROFILE }} | ||
AZURE_ENDPOINT_NAME: ${{ vars.PROD__AZURE_ENDPOINT_NAME }} | ||
AZURE_RESOURCE_GROUP: ${{ vars.PROD__AZURE_RESOURCE_GROUP }} | ||
|
||
jobs: | ||
cicd: | ||
name: DEV__CICD | ||
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: ${{ secrets.PROD_AZURE_CREDS }} | ||
|
||
- name: Upload to blob storage | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: | | ||
az storage blob upload-batch --account-name ${{ env.AZURE_STORAGE_ACCOUNT_NAME }} --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 ${{ env.AZURE_CDN_PROFILE }} --name ${{ env.AZURE_ENDPOINT_NAME }} --resource-group ${{ env.AZURE_RESOURCE_GROUP }} | ||
- name: Azure logout | ||
run: | | ||
az logout | ||
if: always() |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.