Skip to content

Commit

Permalink
feat: Add deployment workflow for new instance: Ethiopia (#5895)
Browse files Browse the repository at this point in the history
  • Loading branch information
elwinschmitz authored Oct 3, 2024
1 parent f439a9b commit fe06916
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy_client-ethiopia_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: 'Deploy [Ethiopia] All'

permissions:
actions: read
deployments: write

on:
workflow_call:
workflow_dispatch:

jobs:
deploy_portal:
name: 'Build + Deploy: Portal'
uses: ./.github/workflows/deploy_client-ethiopia_portal.yml
secrets:
AZURE_STATIC_WEB_APPS_API_TOKEN_PORTAL: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PORTAL }}

deploy_service:
name: 'Build + Deploy: 121-Service'
uses: ./.github/workflows/deploy_client-ethiopia_service.yml
secrets:
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
69 changes: 69 additions & 0 deletions .github/workflows/deploy_client-ethiopia_portal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: 'Deploy [Ethiopia] Interface: Portal'

env:
workingDirectory: interfaces/Portal

permissions:
actions: read

on:
workflow_call:
secrets:
AZURE_STATIC_WEB_APPS_API_TOKEN_PORTAL:
required: true
workflow_dispatch:

jobs:
build_and_deploy:
name: Build and Deploy Job
runs-on: ubuntu-latest
environment: 'client-ethiopia'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Interface
id: build
uses: ./.github/actions/build-interface
with:
interfacePath: ${{ env.workingDirectory }}
envIcon: 'AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAACd38ADCJBwCvRw8AGhLaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEREREREREREREREREREREREREQzNEREREREQzMzREREEREzExMxERERETMxMzERERERMRMRMREREREzMTMxEREiIiMxMyIiIiIiIjMyIiIiIiIiIiIiIiIiIiIiIiIiIgAAAAAAAAAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAD//wAA'
envContentSecurityPolicy: >-
connect-src 'self' https://ethiopia.121.global https://westeurope-5.in.applicationinsights.azure.com https://westeurope.livediagnostics.monitor.azure.com;
form-action https://ethiopia.121.global;
frame-src blob: 'self' https://app.powerbi.com;
frame-ancestors 'self';
env:
NG_ENV_NAME: 'Ethiopia'
NG_LOCALES: ${{ vars.NG_LOCALES }}
NG_URL_121_SERVICE_API: 'https://ethiopia.121.global/api'
USE_SSO_AZURE_ENTRA: ${{ vars.USE_SSO_AZURE_ENTRA }}
AZURE_ENTRA_CLIENT_ID: ${{ vars.AZURE_ENTRA_CLIENT_ID }}
AZURE_ENTRA_TENANT_ID: ${{ vars.AZURE_ENTRA_TENANT_ID }}
AZURE_ENTRA_URL: ${{ vars.AZURE_ENTRA_URL }}
NG_AI_IKEY: '096c811c-3306-4dd5-b756-a6cd08f3c136'
NG_AI_ENDPOINT: 'https://westeurope-5.in.applicationinsights.azure.com/'
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}

# More information on Static Web App workflow configurations,
# See: https://aka.ms/swaworkflowconfig
- name: Deploy to Azure Static Web App
id: deploy_to_aswa
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PORTAL }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
config_file_location: '${{ env.workingDirectory }}/'
app_location: '${{ env.workingDirectory }}/www'
output_location: ''
skip_app_build: true
skip_api_build: true

- name: Finish
run: |
echo "Build version: ${{ steps.build.outputs.build_version }}" >> $GITHUB_STEP_SUMMARY
echo "Preview: <${{ steps.deploy_to_aswa.outputs.static_web_app_url }}>" >> $GITHUB_STEP_SUMMARY
54 changes: 54 additions & 0 deletions .github/workflows/deploy_client-ethiopia_service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# Also, see: https://github.com/Azure/actions-workflow-samples

name: 'Deploy [Ethiopia] 121-service'

env:
AZURE_WEBAPP_NAME: '121-ethiopia'
AZURE_WEBAPP_PACKAGE_PATH: services/121-service

defaults:
run:
working-directory: services/121-service

permissions:
actions: read

on:
workflow_call:
secrets:
AZURE_WEBAPP_PUBLISH_PROFILE:
required: true
workflow_dispatch:

jobs:
build-and-deploy:
name: Build and Deploy
environment: 'client-ethiopia'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build Service
id: build
uses: ./.github/actions/build-service
with:
downloadDatabaseCertificate: true
servicePath: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Deploy to Azure App Service
id: deploy_to_aas
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/artifact.zip'
type: zip
clean: true

- name: Finish
run: |
echo "Build version: ${{ steps.build.outputs.build_version }}" >> $GITHUB_STEP_SUMMARY
echo "Preview: <${{ steps.deploy_to_aas.outputs.webapp-url }}>" >> $GITHUB_STEP_SUMMARY

0 comments on commit fe06916

Please sign in to comment.