Skip to content

measure changes

measure changes #488

Workflow file for this run

# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: dev_api
on:
push:
branches:
- dev
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: "." # set this to the path to your web app project, defaults to the repository root
jobs:
deploy:
permissions:
id-token: write #This is required for requesting the JWT
contents: read #This is required for actions/checkout
if: github.event.repository.fork == false && github.event_name == 'push'
runs-on: windows-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup PowerShell module cache
id: cacher
uses: actions/cache@v3
with:
path: "~/.local/share/powershell/Modules"
key: ${{ runner.os }}-ModuleBuilder
- name: Install ModuleBuilder
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module ModuleBuilder -AllowClobber -Force
- name: Build CIPPCore Module
shell: pwsh
run: |
$ModulePath = Join-Path $env:GITHUB_WORKSPACE "Modules/CIPPCore"
$OutputPath = Join-Path $env:GITHUB_WORKSPACE "Output"
Write-Host "Building module from: $ModulePath"
Write-Host "Output directory: $OutputPath"
# Build the module using ModuleBuilder
Build-Module -SourcePath $ModulePath -OutputDirectory $OutputPath -Verbose
# Replace the source module with the built module
Remove-Item -Path $ModulePath -Recurse -Force
Copy-Item -Path (Join-Path $OutputPath "CIPPCore") -Destination $ModulePath -Recurse -Force
Write-Host "Module built and replaced successfully"
# Clean up output directory
Remove-Item -Path $OutputPath -Recurse -Force
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.DEV_CLIENTID }}
tenant-id: ${{ secrets.DEV_TENANTID }}
subscription-id: ${{ secrets.DEV_SUBSCRIPTIONID }}
- name: "Run Azure Functions Action"
uses: Azure/functions-action@v1
id: fa
with:
app-name: "cippjta72"
slot-name: "Production"
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}