Skip to content

Merge pull request #1321 from MHRA/updateMainPageText #83

Merge pull request #1321 from MHRA/updateMainPageText

Merge pull request #1321 from MHRA/updateMainPageText #83

name: medicines-web-master
on:
push:
branches:
- master
paths:
- medicines/web/**
- .github/workflows/medicines-web-master.yaml
env:
AZURE_SEARCH_API_VERSION: 2017-11-11
AZURE_SEARCH_EXACTNESS_BOOST: 4
AZURE_SEARCH_INDEX: products-index
AZURE_SEARCH_KEY: EB09FBB43EBD24C1C8D5983A9C00B497
AZURE_SEARCH_SCORING_PROFILE: preferKeywords
AZURE_SEARCH_SERVICE: mhraproductsnonprod
AZURE_SEARCH_WORD_FUZZINESS: 1
GOOGLE_GTM_CONTAINER_ID: GTM-WJ5TW34
GOOGLE_TRACKING_ID: UA-6838115-11
GOOGLE_USE_DEBUG: true
ROOT_URL_DOMAIN: .windows.net
GRAPHQL_URL: https://medicines-api.non-prod.mhra.gov.uk/graphql
USE_GRAPHQL: false
SHOW_BMGF: true
BMGF_AZURE_SEARCH_INDEX: bmgf-index
AZURE_STORAGE_ACCOUNT: mhraproductsnonprod
AZURE_STORAGE_KEY: ${{ secrets.PRODUCTS_STORAGE_MASTER_KEY_NONPROD }}
ENV: staging
jobs:
build:
name: Build, test and deploy
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
- 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: Deploy products web to static site in azure storage using azure cli
uses: Azure/cli@v1.0.7
with:
azcliversion: latest
inlineScript: |
az storage blob upload-batch -d "\$web" -s "medicines/web/dist" --overwrite true --connection-string "${{ secrets.AZURE_STORAGE_PRODUCTS_WEB_CONNECTION_STRING }}"