Created
January 6, 2020 10:11
-
-
Save weeyin83/b63d320cc814dee9aebb599b847d0a49 to your computer and use it in GitHub Desktop.
Example workflow that can be used to create a VM in Azure
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: GitHub for IT Pro CI/CD Pipeline | |
env: | |
OUTPUT_PATH: ${{ github.workspace }} | |
on: [push] | |
jobs: | |
# Deploy VM in Azure | |
DeployVM: | |
runs-on: windows-latest | |
steps: | |
# checkout code from repo | |
- name: checkout repo | |
uses: actions/checkout@v1 | |
- name: look for ps1 file | |
run: | | |
ls '${{ env.OUTPUT_PATH }}\IaC\AzCLI' | |
- name: provision virtual machine in azure | |
env: | |
RESOURCE_GROUP: rg-githubitpro | |
RESOURCE_GROUP_REGION: southcentralus | |
SERVER_NAME: gihtubactions | |
ADMIN_LOGIN: sarah | |
run: > | |
powershell -command "& '${{ env.OUTPUT_PATH }}\IaC\AzCLI\vmcreation.ps1'" | |
-servicePrincipal ${{ secrets.SERVICE_PRINCIPAL_APPID }} | |
-servicePrincipalSecret ${{ secrets.SERVICE_PRINCIPAL_SECRET }} | |
-servicePrincipalTenantId ${{ secrets.SERVICE_PRINCIPAL_TENANTID }} | |
-azureSubscriptionName ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
-resourceGroupName %RESOURCE_GROUP% | |
-resourceGroupNameRegion %RESOURCE_GROUP_REGION% | |
-serverName %SERVER_NAME% | |
-adminLogin %ADMIN_LOGIN% | |
-adminPassword ${{ secrets.ADMIN_PASSWORD }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment