-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 2.3 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
71
72
73
74
75
76
77
78
79
80
name: Deploy_To_Azure_Blobs_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: '27 04 * * *' # 0424am daily
env:
STORAGE_ACCOUNT_NAME: savalidatorwebvuedev # storage account name
STORAGE_ACCOUNT_KEY: ${{ secrets.DEV_STORAGE_KEY }} # storage account 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@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: |
npm install
- name: Copy dev environment variables to production file
run: |
rm ./envs/.env.production
cp ./envs/.env.development ./envs/.env.production
- name: Run build
run: |
npm run build:production
- 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/
integration-test:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cypress CI Run
uses: cypress-io/github-action@v6
with:
wait-on: 'https://dev-validator.iatistandard.org'
config-file: cypress.config.dev.js
# Mark status checks success/fail on dependabot commits for scheduled deploys
status_check_success:
needs: [deploy, integration-test]
if: success() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_success.yaml@main
status_check_failure:
needs: [deploy, integration-test]
if: failure() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_failure.yaml@main