Skip to content

Deploy optimus_widgetbook to Microsoft Azure #15

Deploy optimus_widgetbook to Microsoft Azure

Deploy optimus_widgetbook to Microsoft Azure #15

name: Deploy optimus_widgetbook to Microsoft Azure
on:
workflow_dispatch:
push:
branches:
- main
paths:
- optimus_widgetbook/**
- optimus/**
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy_widgetbook_azure:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID}}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Setup Flutter environment
uses: ./.github/actions/setup
- name: Build Web
run: |
melos exec --scope="optimus_widgetbook" -- "flutter build web"
- name: Modify manifest.json
run: |
sed -i 's|^{|{"latest": "release", |' optimus_widgetbook/build/web/manifest.json
- name: Upload manifest.json to blob storage root
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob upload --overwrite true --container-name mews-ui-widgetbook --file optimus_widgetbook/build/web/manifest.json --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
- name: Upload to blob storage release folder
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob upload-batch --overwrite true --destination mews-ui-widgetbook/release --source optimus_widgetbook/build/web --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login