This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (58 loc) · 1.95 KB
/
develop_CD.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
name: Deploy_To_Azure_Blobs_NG_Dev
on:
push:
paths-ignore: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '**/README.md' # don't run on README.md file updates anywhere in repo
- '**/dependabot.yml'
branches:
- develop
schedule:
- cron: '22 04 * * *' # 0422am daily
env:
STORAGE_ACCOUNT_NAME: savalidatorwebdev
STORAGE_ACCOUNT_KEY: ${{ secrets.DEV_STORAGE_KEY }}
jobs:
should_run:
uses: IATI/.github/.github/workflows/should_run.yaml@main
deploy:
needs: should_run
if: ${{ needs.should_run.outputs.should_run == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: |
npm install --ignore-scripts
- name: Copy environment specific env.js file
run: |
cp src/env.dev.js src/env.js
- name: Run build
run: |
npm run build:dev
- name: Create 404
run: cp dist/index.html dist/404.html
- name: Upload to blob storage
uses: azure/CLI@v1
with:
azcliversion: 2.34.0
inlineScript: |
az storage blob upload-batch \
--overwrite true \
--account-name ${{ env.STORAGE_ACCOUNT_NAME }} \
--account-key ${{ env.STORAGE_ACCOUNT_KEY }} \
-d '$web' \
-s dist/
# Mark status checks success/fail on dependabot commits for scheduled deploys
status_check_success:
needs: [deploy]
if: success() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_success.yaml@main
status_check_failure:
needs: [deploy]
if: failure() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_failure.yaml@main