Skip to content

1.13.5 release

1.13.5 release #56

Workflow file for this run

on:
push:
branches:
- main
- develop
env:
BUILD_VERSION: '1.13.5'
jobs:
select-environment:
runs-on: ubuntu-latest
steps:
- name: Select environment from branch name
id: select-environment
shell: pwsh
run: |
if ("${{github.ref}}" -eq "refs/heads/main") {
Write-Output "env-name=production" >> $env:GITHUB_OUTPUT
}
if ("${{github.ref}}" -eq "refs/heads/develop") {
Write-Output "env-name=development" >> $env:GITHUB_OUTPUT
}
outputs:
env-name: ${{steps.select-environment.outputs.env-name}}
build-client:
needs: select-environment
runs-on: ubuntu-latest
environment:
name: ${{needs.select-environment.outputs.env-name}}
steps:
- name: Checkout repos
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Update package.json
run: npm version ${{env.BUILD_VERSION}} --no-git-tag-version
- name: Update microsoft-identity-association.json
shell: pwsh
run: |
$content = Get-Content -Path ${{env.FILE_PATH}}
$content = $content -replace "{{APP_CLIENT_ID}}", "${{secrets.APP_CLIENT_ID}}"
Out-File -FilePath ${{env.FILE_PATH}} -InputObject $content -Encoding UTF8
env:
FILE_PATH: public/.well-known/microsoft-identity-association.json
- name: Update .env
shell: pwsh
run: |
$content = Get-Content -Path ${{env.FILE_PATH}}
$content = $content -replace "{{TELEMETRY_CONNECTION_STRING}}", "${{secrets.TELEMETRY_CONNECTION_STRING}}"
$content = $content -replace "{{APP_TENANT_ID}}", "${{secrets.APP_TENANT_ID}}"
$content = $content -replace "{{APP_CLIENT_ID}}", "${{secrets.APP_CLIENT_ID}}"
$content = $content -replace "{{APP_DOMAIN_NAME}}", "${{secrets.APP_DOMAIN_NAME}}"
Out-File -FilePath ${{env.FILE_PATH}} -InputObject $content -Encoding UTF8
env:
FILE_PATH: .env
- name: Restore source
run: npm ci
- name: Audit source
run: npm audit --omit=dev
- name: Build source
run: npm run build
- name: Test source
run: npm run test:ci
- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: hitofude
path: dist
- name: Upload test results
uses: enricomi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: test/*.xml
check_name: test-results
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
fail_ci_if_error: true
token: ${{secrets.CODECOV_TOKEN}}
slug: karamem0/hitofude
deploy-client:
needs:
- select-environment
- build-client
runs-on: ubuntu-latest
environment:
name: ${{needs.select-environment.outputs.env-name}}
steps:
- name: Download build files
uses: actions/download-artifact@v4
with:
name: hitofude
path: artifact
- name: Connect to Azure
uses: azure/login@v2
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
- name: Upload to blob storage
uses: azure/cli@v2
with:
inlineScript: |
az storage blob delete-batch --account-name ${{secrets.AZURE_STORAGE_ACCOUNT_NAME}} --auth-mode login --source '$web'
az storage blob upload-batch --account-name ${{secrets.AZURE_STORAGE_ACCOUNT_NAME}} --auth-mode login --destination '$web' --source artifact
az cdn endpoint purge --content-paths '/*' --profile-name ${{secrets.AZURE_CDN_PROFILE_NAME}} --name ${{secrets.AZURE_CDN_ENDPOINT_NAME}} --resource-group ${{secrets.AZURE_RESOURCE_GROUP_NAME}}