-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (102 loc) · 3.49 KB
/
medicines-web-release.yaml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: medicines-web-release
on:
push:
tags:
- medicinesweb.v*
env:
AZURE_SEARCH_API_VERSION: 2017-11-11
AZURE_SEARCH_EXACTNESS_BOOST: 4
AZURE_SEARCH_INDEX: products-index
AZURE_SEARCH_KEY: 17CCFC430C1A78A169B392A35A99C49D
AZURE_SEARCH_SCORING_PROFILE: preferKeywords
AZURE_SEARCH_SERVICE: mhraproducts4853
AZURE_SEARCH_WORD_FUZZINESS: 1
GOOGLE_GTM_CONTAINER_ID: GTM-WJ5TW34
GOOGLE_TRACKING_ID: UA-6838115-13
GOOGLE_USE_DEBUG: false
ROOT_URL_DOMAIN: .windows.net
GRAPHQL_URL: https://medicines.api.mhra.gov.uk/graphql
USE_GRAPHQL: false
SHOW_BMGF: true
BMGF_AZURE_SEARCH_INDEX: bmgf-index
AZURE_STORAGE_ACCOUNT: mhraproducts4853
AZURE_STORAGE_KEY: ${{ secrets.PRODUCTS_STORAGE_MASTER_KEY_PROD }}
ENV: production
jobs:
build:
name: Build, test, create release and deploy to production
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: "14.15"
- name: Install modules
working-directory: medicines/web
run: yarn install --frozen-lockfile
- name: Run tests with coverage
working-directory: medicines/web
run: yarn test:ci
env:
ENV: test
- name: Build and export
working-directory: medicines/web
run: yarn build && yarn export
- name: Write variables to .env
working-directory: medicines/web
run: |
{
echo "AZURE_SEARCH_SERVICE=\"$AZURE_SEARCH_SERVICE\""
echo "AZURE_SEARCH_INDEX=\"$AZURE_SEARCH_INDEX\""
echo "AZURE_SEARCH_KEY=\"$AZURE_SEARCH_KEY\""
echo "GRAPHQL_URL=\"$GRAPHQL_URL\""
echo "BMGF_AZURE_SEARCH_INDEX=\"$BMGF_AZURE_SEARCH_INDEX\""
} > .env
- name: Run cypress end-to-end tests
working-directory: medicines/web
run: mkdir -p cypress/screenshots && yarn test-e2e
env:
ROOT_URL_DOMAIN: localhost
- name: Upload cypress screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: medicines-cypress-screenshots
path: medicines/web/cypress/screenshots
- name: Upload cypress videos
uses: actions/upload-artifact@v4
if: always()
with:
name: medicines-cypress-videos
path: medicines/web/cypress/videos
- name: Accessibility check
working-directory: medicines/web
run: yarn a11y
env:
ROOT_URL_DOMAIN: localhost
- name: Upload pa11y screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: medicines-pa11y-screenshots
path: medicines/web/pa11y-screenshots
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Medicines website release ${{ github.ref }}
body: |
Release of Medicines website
draft: false
prerelease: false
- name: Deploy products web to static site in azure storage using azure cli
uses: Azure/[email protected]
with:
azcliversion: latest
inlineScript: |
az storage blob upload-batch -d "\$web" -s "medicines/web/dist" --overwrite true --connection-string "${{ secrets.AZURE_STORAGE_PROD_PRODUCTS_WEB_CONNECTION_STRING }}"