Merge pull request #3 from markgar/feature-mgarner #18
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
# This is a basic workflow to help you get started with Actions | |
name: Deploy to Production Workspace | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Triggers the workflow when a pull request is merged into the main branch | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
- '/*' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a single command using the runners shell | |
- name: Install Prerequisites | |
shell: pwsh | |
run: | | |
Install-Module Az -Force | |
Import-Module Az.Accounts -Force | |
Install-Module FabricPS -Force | |
Import-Module FabricPS -Force | |
- name: Connect with SPN | |
shell: pwsh | |
run: | | |
# Define Service Principal credentials | |
$clientId = '${{ secrets.client_id }}' # Replace with your SP's Application (Client) ID | |
$tenantId = '${{ secrets.tenant_id }}' # Replace with your Azure Tenant ID | |
$clientSecret = '${{ secrets.client_secret }}' # Replace with your SP's Client Secret | |
# Convert the client secret to a SecureString | |
$secureClientSecret = ConvertTo-SecureString -String $clientSecret -AsPlainText -Force | |
# Create a PSCredential object | |
$credential = New-Object System.Management.Automation.PSCredential ($clientId, $secureClientSecret) | |
# Connect to Azure using the Service Principal | |
Connect-AzAccount -ServicePrincipal -Credential $credential -TenantId $tenantId | |
- name: Deploy some stuff | |
shell: pwsh | |
run: ./deploy.ps1 | |