Skip to content

Deploy the New Relic Azure Site Extension #8

Deploy the New Relic Azure Site Extension

Deploy the New Relic Azure Site Extension #8

name: Deploy the New Relic Azure Site Extension
on:
workflow_dispatch:
inputs:
run_id:
description: 'Run ID of the Release Workflow (siteextension_release.yml) that was triggered by creating a Release in GitHub. ID can be found in URL for run.'
required: true
deploy:
description: 'If "true", deploy the artifacts. If "false", do everything except deploy.'
required: true
default: 'false'
env:
DOTNET_NOLOGO: true
permissions:
actions: read
contents: read
jobs:
deploy-nuget:
name: Deploy to NuGet
runs-on: windows-2019
env:
nuget_source: https://www.nuget.org
steps:
- name: Download Deploy Artifacts
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.inputs.run_id }}
name: deploy-artifacts
path: ${{ github.workspace }}
repository: ${{ github.repository }}
- name: Setup NuGet API Key
run: |
nuget.exe setApiKey ${{ secrets.NUGET_APIKEY }} -Source ${{ env.nuget_source }}
shell: pwsh
- name: Deploy New Relic Azure Site Extension to Nuget
run: |
$packageName = Get-ChildItem ${{ github.workspace }}\AzureSiteExtension\NewRelic.Azure.WebSites.Extension.*.nupkg -Name
$packagePath = Convert-Path ${{ github.workspace }}\AzureSiteExtension\$packageName
if ("${{ github.event.inputs.deploy }}" -eq "true") {
nuget.exe push $packagePath -Source ${{ env.nuget_source }}
}
else {
Write-Host "Input:deploy was not true (${{ github.event.inputs.deploy }}). The following deploy command was not run:"
Write-Host "nuget.exe push $packagePath -Source ${{ env.nuget_source }}"
}
shell: powershell