-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.44 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
81
82
83
84
85
86
87
88
89
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: "24 04 * * *" # 0424am daily
env:
STORAGE_ACCOUNT_NAME: sadatastoresearchdev
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@v4
- name: Set up Node.js
uses: actions/[email protected]
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: Create robots.txt
run: |
echo -e 'User-agent: *\nDisallow: /\n' > dist/robots.txt
- 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: Set up Node.js
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Cypress CI Run
uses: cypress-io/github-action@v6
with:
wait-on: "https://dev-datastore.iatistandard.org"
config-file: cypress.config.dev.js
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