Skip to content

Commit

Permalink
Last set of tweaks for RMI Azure deployment (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcspragu authored Nov 16, 2024
1 parent 3ce6a0e commit 4dc23b1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev
environment: test
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -27,9 +27,9 @@ jobs:
- name: Azure CLI login
uses: azure/login@v1
with:
client-id: ${{ secrets.DEV_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
client-id: ${{ secrets.TEST_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.TEST_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.TEST_AZURE_SUBSCRIPTION_ID }}
allow-no-subscriptions: false

- name: Login to ACR via OIDC
Expand All @@ -47,7 +47,7 @@ jobs:
working-directory: frontend
run: |
npm ci
npm run build:dev
npm run build:test
npm run lint
npm run typecheck
Expand All @@ -57,18 +57,18 @@ jobs:
- name: Push docker images
run: |
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/server:push_image -- --tag=dev
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/runner:push_image -- --tag=dev
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/parser:push_image -- --tag=dev
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/server:push_image -- --tag=test
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/runner:push_image -- --tag=test
bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/parser:push_image -- --tag=test
- name: Deploy backend on Container Apps
uses: azure/container-apps-deploy-action@v1
with:
disableTelemetry: true
containerAppName: pactasrv-dev
containerAppEnvironment: pacta-dev
resourceGroup: rmi-pacta-dev
imageToDeploy: rmisa.azurecr.io/pacta:dev
containerAppName: pactasrv-test
containerAppEnvironment: pacta-test
resourceGroup: RMI-SP-PACTA-WEU-PAT-DEV
imageToDeploy: rmisppactaweupatdev.azurecr.io/pacta:test
location: centralus

- name: Deploy frontend
Expand All @@ -81,4 +81,4 @@ jobs:
output_location: ''
skip_app_build: true
skip_api_build: true
azure_static_web_apps_api_token: ${{ secrets.DEV_AZURE_STATIC_WEB_APPS_API_TOKEN }}
azure_static_web_apps_api_token: ${{ secrets.TEST_AZURE_STATIC_WEB_APPS_API_TOKEN }}
4 changes: 2 additions & 2 deletions cmd/server/configs/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ port 80

use_azure_runner true

azure_event_subscription 69b6db12-37e3-4e1f-b48c-aa41dba612a9
azure_event_resource_group rmi-pacta-test
azure_event_subscription feef729b-4584-44af-a0f9-4827075512f9
azure_event_resource_group RMI-SP-PACTA-WEU-PAT-DEV
azure_event_topic pacta-events-test

15 changes: 15 additions & 0 deletions frontend/envs/env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
AUTH_SERVER_URL=https://auth-api.dev.rmi.siliconally.dev
API_SERVER_URL=https://pacta-api.dev.rmi.siliconally.dev

MSAL_USER_FLOW_NAME=B2C_1_susi_dev
MSAL_USER_FLOW_AUTHORITY=https://rmiauthdev.b2clogin.com/rmiauthdev.onmicrosoft.com/B2C_1_susi_dev
MSAL_AUTHORITY_DOMAIN=rmiauthdev.b2clogin.com
MSAL_CLIENT_ID=218f47ee-11b1-459a-b914-b7fa6f107e7b
# See https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations
MSAL_REDIRECT_URI=https://pacta.dev.rmi.siliconally.dev/blank
MSAL_LOGOUT_URI=https://pacta.dev.rmi.siliconally.dev/
MSAL_MIN_LOG_LEVEL=INFO

BASE_URL=https://pacta.dev.rmi.siliconally.dev

I18N_STRATEGY=prefix
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"build:local": "nuxt build --dotenv=envs/env.local",
"build:dev": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.dev",
"deploy:dev": "npm run build:dev && swa deploy pacta-frontend-dev --no-use-keychain --app-name pacta-frontend-dev --resource-group rmi-pacta-dev --env Production",
"build:test": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.test",
"deploy:test": "npm run build:test && swa deploy pacta-frontend-test --no-use-keychain --app-name pacta-frontend-test --resource-group RMI-SP-PACTA-WEU-PAT-DEV --env Production",
"typecheck": "nuxi typecheck",
"lint": "eslint --cache --ext .js,.vue,.ts ./ && stylelint --cache '**/*.{vue,css,scss}'",
"lint:fix": "eslint --fix --ext .js,.vue,.ts ./ && stylelint '**/*.{vue,css,scss}' --fix",
Expand Down
10 changes: 5 additions & 5 deletions frontend/swa-cli.config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"pacta-frontend-dev": {
"pacta-frontend-test": {
"appLocation": ".",
"apiLocation": ".output/server",
"outputLocation": ".output/public",
"appBuildCommand": "npm run build:dev",
"appBuildCommand": "npm run build:test",
"run": "npm run local",
"appDevserverUrl": "http://localhost:3000",
"apiDevserverUrl": "http://localhost:8081",
"appName": "pacta-frontend-dev",
"resourceGroup": "rmi-pacta-dev"
"appName": "pacta-frontend-test",
"resourceGroup": "RMI-SP-PACTA-WEU-PAT-DEV"
}
}
}
}

0 comments on commit 4dc23b1

Please sign in to comment.