Skip to content

La til forfatter i jsonfilene for helseatlas #533

La til forfatter i jsonfilene for helseatlas

La til forfatter i jsonfilene for helseatlas #533

Workflow file for this run

name: Deploy app to Azure
on:
push:
branches: [main, develop]
paths-ignore:
- "apps/api/**"
pull_request:
branches: [main, develop, dependency_updates]
paths-ignore:
- "apps/api/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy_to_storage:
name: Deploy app to Azure
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_SENTRY: "https://[email protected]/5799127"
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Enable Corepack before setting up Node
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
- run: corepack enable && yarn install
- run: yarn run check-types
- run: yarn run check-format
- name: Test build
env:
NEXT_PUBLIC_API_HOST: https://prod-mong-api.skde.org
run: |
yarn run export
- name: Build and upload main branch version to Azure
if: github.ref == 'refs/heads/main'
env:
NEXT_PUBLIC_API_HOST: https://prod-mong-api.skde.org
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT_PROD }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY_PROD }}
run: |
yarn run export
az storage blob sync \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--container '$web' \
--source ./apps/skde/out \
--delete-destination true
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.html' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.xml' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite
- name: Build and upload verify version to Azure
if: github.ref == 'refs/heads/main'
env:
NEXT_PUBLIC_VERIFY: "true"
NEXT_PUBLIC_API_HOST: https://verify-mong-api.skde.org
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT_VERIFY }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY_VERIFY }}
run: |
yarn run export
az storage blob sync \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--container '$web' \
--source ./apps/skde/out \
--delete-destination true
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.html' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.xml' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite
- name: Upload develop version to Azure
if: github.ref == 'refs/heads/develop'
env:
NEXT_PUBLIC_API_HOST: https://qa-mong-api.skde.org
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT_TEST }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY_TEST }}
run: |
yarn run export
az storage blob sync \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--container '$web' \
--source ./apps/skde/out \
--delete-destination true
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.html' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite
az storage blob upload-batch \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--destination '$web' \
--source ./apps/skde/out \
--pattern '*.xml' \
--content-cache-control "public, max-age=60, s-maxage=60" \
--overwrite