testing automation flow #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Azure Resources-Updated | |
on: | |
push: | |
branches: | |
- PSL-Automation-Flow-Draft | |
workflow_dispatch: | |
inputs: | |
environmentName: | |
description: 'The name of the environment' | |
required: true | |
default: "pslTestAuto2" | |
location: | |
description: 'The location for the deployment' | |
required: true | |
default: "eastus2" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Azure CLI | |
run: | | |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | |
az --version # Verify installation | |
- name: Login to Azure | |
run: | | |
az login --service-principal -u ${{ secrets.AUTO_AZURE_CLIENT_ID }} -p ${{ secrets.AUTO_AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AUTO_AZURE_TENANT_ID }} | |
az account set --subscription ${{ secrets.AUTO_AZURE_SUBSCRIPTION_ID }} | |
echo "TestAZURE_SUBSCRIPTION_ID=${{ secrets.AUTO_AZURE_SUBSCRIPTION_ID }}" | |
echo "TestAZURE_CLIENT_ID=${{ secrets.AUTO_AZURE_CLIENT_ID }}" | |
echo "TestAZURE_CLIENT_SECRET=${{ secrets.AUTO_AZURE_CLIENT_SECRET }}" | |
echo "TestAZURE_TENANT_ID=${{ secrets.AUTO_AZURE_TENANT_ID }}" | |
- name: Install Bicep CLI | |
run: az bicep install | |
- name: Deploy Bicep Template | |
run: | | |
echo "Environment Name: ${{ github.event.inputs.environmentName }}" | |
echo "Location: ${{ github.event.inputs.location }}" | |
az deployment sub create \ | |
--name autoDemo \ | |
--location eastus \ | |
--template-file infra/main.bicep \ | |
# --parameters environmentName=${{ github.event.inputs.environmentName }} location=${{ github.event.inputs.location }} | |
--parameters environmentName=pslautomation location=eastus2 |