Skip to content

Add cherry picked test and dependencies #2062

Add cherry picked test and dependencies

Add cherry picked test and dependencies #2062

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: 'Deploy [test] Interface: Portalicious'
env:
workingDirectory: interfaces/Portalicious
on:
workflow_call:
secrets:
AZURE_STATIC_WEB_APPS_API_TOKEN_PORTALICIOUS:
required: true
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/deploy_test_portalicious.yml'
- 'interfaces/Portalicious/**'
- '!*.md'
- '!*.yml'
pull_request:
types: [opened, synchronize, reopened, closed]
paths:
- '.github/workflows/deploy_test_portalicious.yml'
- 'interfaces/Portalicious/**'
- '!*.md'
- '!*.yml'
jobs:
test:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
permissions:
actions: read
# Disabling this to avoid spamming the PR with "Your stage site is ready!" comments
# https://github.com/Azure/static-web-apps/issues/1135#issuecomment-1750066331
# pull-requests: write
environment: 'test'
env:
NG_ENV_NAME: ${{ vars.NG_ENV_NAME }}
NG_LOCALES: 'en-GB,nl'
NG_DEFAULT_LOCALE: 'en-GB'
NG_URL_121_SERVICE_API: ${{ vars.NG_URL_121_SERVICE_API }}
USE_IN_TWILIO_FLEX_IFRAME: ${{ vars.USE_IN_TWILIO_FLEX_IFRAME }}
USE_POWERBI_DASHBOARDS: ${{ vars.USE_POWERBI_DASHBOARDS }}
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 }}
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}
outputs:
preview_url: ${{ steps.deploy_to_aswa.outputs.static_web_app_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Interface
id: build
uses: ./.github/actions/build-interface
with:
interfacePath: ${{ env.workingDirectory }}
envIcon: 'AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAABNIQAA/OrwAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAiIgAgAAACABAAACAAAAIAAgAAIAAAAgAAIAAgAAACAAACACAAAAIAIAIAIAAAAgAgAgAgAAACAAIgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
envIconPath: 'src/assets/favicon.ico'
envContentSecurityPolicy: '' # Not used for Portalicious, the `build:deployment-configuration`-script is used.
# 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
env:
SKIP_DEPLOY_ON_MISSING_SECRETS: true
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PORTALICIOUS }}
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: Verify Deployment
if: steps.deploy_to_aswa.outputs.static_web_app_url != ''
working-directory: ${{ env.workingDirectory }}
run: |
npm run verify:deployment-configuration -- --url=${{ steps.deploy_to_aswa.outputs.static_web_app_url }}
- 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
add_preview_link:
if: (github.event_name == 'pull_request' && github.event.action != 'closed' && needs.test.outputs.preview_url != '')
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add Deployment URL to PR Description
uses: nefrob/[email protected]
with:
content: ${{ needs.test.outputs.preview_url }}
regex: '<!-- start deployment url -->.*?<!-- end deployment url -->'
regexFlags: ims
appendContentOnMatchOnly: true
token: ${{ secrets.GITHUB_TOKEN }}
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
environment: 'test'
steps:
- name: 'Close Pull Request: Deploy to Azure Static Web App'
uses: Azure/static-web-apps-deploy@v1
env:
SKIP_DEPLOY_ON_MISSING_SECRETS: true
with:
app_location: '${{ env.workingDirectory }}/www'
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PORTALICIOUS }}
action: 'close'