Skip to content

Bump @babel/traverse from 7.21.4 to 7.23.2 in /web #89

Bump @babel/traverse from 7.21.4 to 7.23.2 in /web

Bump @babel/traverse from 7.21.4 to 7.23.2 in /web #89

Workflow file for this run

name: Azure Dev
on:
push:
branches:
- main
- session01
- session02
- session03
pull_request:
branches:
- main
workflow_dispatch:
env:
# set this to the name of your Azure Resource Group
AZURE_RESOURCE_GROUP_NAME: 'rg-${{ vars.AZURE_ENV_NAME }}'
# set this to the name of your Azure Static Web Apps
AZURE_STTAPP_NAME: 'sttapp-${{ vars.AZURE_ENV_NAME }}-web'
# set this to the name of your Azure App Service
AZURE_WEBAPP_NAME: 'appsvc-${{ vars.AZURE_ENV_NAME }}-api'
# set this to the name of your Azure API Management
AZURE_APIM_NAME: 'apim-${{ vars.AZURE_ENV_NAME }}'
# set this to the Java version to use
JAVA_VERSION: '17'
# set this to the OpenJDK distribution to use
DISTRIBUTION: microsoft
permissions:
contents: read
id-token: write
jobs:
build_and_deploy_aswa:
name: Build and Deploy to ASWA (Frontend)
runs-on : ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Install ASWA CLI
shell: bash
run: |
npm install -g @azure/static-web-apps-cli
- name: Create artifacts
shell: bash
run: |
swa build
- name: Login to Azure
uses: Azure/login@v1
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Get SWA token
shell: bash
run: |
swa_token=$(az staticwebapp secrets list \
-g ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
-n ${{ env.AZURE_STTAPP_NAME }} \
--query "properties.apiKey" -o tsv)
echo "::add-mask::$swa_token"
echo "SWA_TOKEN=$swa_token" >> $GITHUB_ENV
- name: Deploy SWA to Azure
shell: bash
run: |
swa deploy \
-d ${{ env.SWA_TOKEN }} \
--env default
- name: Get ASWA hostname
id: sttapp
shell: bash
run: |
hostname=$(az staticwebapp show \
-g ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
-n ${{ env.AZURE_STTAPP_NAME }} \
--query "defaultHostname" -o tsv)
echo "hostname=$hostname" >> $GITHUB_OUTPUT
- name: Update APIM Named Value
shell: bash
run: |
hostname=${{ steps.sttapp.outputs.hostname }}
nv=$(az apim nv update \
-g ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
-n ${{ env.AZURE_APIM_NAME }} \
--named-value-id STTAPP_URL \
--value $hostname)
- name: Check APIM Product with API
id: apimcheck
shell: bash
run: |
hostname=$(echo "${{ steps.sttapp.outputs.hostname }}" | cut -d'.' -f1)
api=$(az apim product api list \
-g ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
-n ${{ env.AZURE_APIM_NAME }} \
--product-id $hostname \
--query "[?name == '${{ env.AZURE_WEBAPP_NAME }}'].name" -o tsv)
if [ "$api" == "" ]; then
checked='false'
else
checked='true'
fi
echo "hostname=$hostname" >> $GITHUB_OUTPUT
echo "checked=$checked" >> $GITHUB_OUTPUT
- name: Update APIM Product with API
if: steps.apimcheck.outputs.checked != 'true'
shell: bash
run: |
hostname=${{ steps.apimcheck.outputs.hostname }}
api=$(az apim product api add \
-g ${{ env.AZURE_RESOURCE_GROUP_NAME }} \
-n ${{ env.AZURE_APIM_NAME }} \
--product-id $hostname \
--api-id ${{ env.AZURE_WEBAPP_NAME }})
build_and_deploy_appservice:
name: Build and Deploy to App Service (Backend)
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up Java version
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.DISTRIBUTION }}
cache: 'maven'
- name: Create artifacts
shell: bash
run: mvn -f api/pom.xml clean install
- name: Login to Azure
uses: Azure/login@v1
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Deploy Web App to Azure
uses: Azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
package: api/target/*.jar